If you can’t answer the three questions above, you should probably pick a different category. Please do not ask people to write entire scripts or design entire systems for you. I get the error attempt to index nil with Humanoid which means that the character can’t be found. Local player = game:GetService("Players"):GetChildren() Try to make your topic as descriptive as possible, so that it’s easier for people to help you! (I also don’t want to use remote events in my case)Īfter that, you should include more details if you have any. I have tried looking on dev forum but everyone keeps saying that you should use player.Character but that is if you are doing it on local script which in my case i’m not. What solutions have you tried so far? Did you look for solutions on the Developer Hub?.I dont know how to get the character of a player from server side. What is the issue? Include screenshots / videos if possible!.I want to get the character of a player so I can check to see if the humanoid died What do you want to achieve? Keep it simple and clear!.Local Target: Vector3 = Head.You can write your topic however you want, but you need to answer these questions: Local Distance: number = 3 - Look 3 studs in the direction of the `Head` Local Direction: Vector3 = Head.LookVector So based on the above, you can do this: local Head: BasePart = So if we want to find the position the character is looking at, we need to multiply this LookVector by a number which will denote the number of studs in the direction of the character we want to look and then add it with the position of the Head. But there is a slight issue, you see- LookVector is not a positional vector but rather a directional vector, as such it will have a Magnitude (length) of 1. And voila you got the direction where the character is facing. To do this, we can reference the character Head and then get the LookVector property of its CFrame. ( since we can't get the CFrame of a model). Now if you wanna find the where the character is looking, we could check the direction the character's Head is facing by utilizing its CFrame. game.Workspace:FindFirstChild (name) could work if it was. and the thing your trying to search aka ' game.Workspace:FindFirstChild (name)' means that your searching for a item in the workspace. name.Character should be the correct wording as a player bool has a character value. So in ROBLOX, all BaseParts have a property named CFrame which represents the Position and Orientation of that BasePart. to get a character, you should do it like this.
0 Comments
Leave a Reply. |
Details
AuthorWrite something about yourself. No need to be fancy, just an overview. ArchivesCategories |