Here is my code:

local character = player:WaitForChild(player.Name)
local humanoid = character:WaitForChild("Humanoid")

do I even need to use the wait for child with humanoid could I just do: local humanoid = character.Humanoid. Just a note: this is an admin script that can be called on other players so I want to make sure everything is there. Thanks!

5 comments

0

You won't need to WaitForChild.

0

And the Character isn't inside the Player object, it's in Workspace.

0

i would use local character = player.Characer and local humanoid = character:FindFirstChildOfClass("Humanoid") , i use that because it works with renamed humanoid too

0

Renaming humanoids is bad practice. Should only be used if necessary.

0

I just realized that this is the wrong way to get the character