I need to find out how to reference a players humanoid without them touching a part. For example, when they join the game their WalkSpeed in their Humanoid is set to 30. Anyone know a script that can help me with this?
COMMUNITY QUESTION
How do I reference a players Humanoid when they join the game?
1 answer
Try this:
game.Players.PlayerAdded:Connect(function(Player)
Player.CharacterAdded:Connect(function(Character)
local Humanoid = Character:FindFirstChild("Humanoid")
end)
end)
It's better you put scripts like this in StarterCharacterScripts so you can simply do Humanoid = script.Parent:FindFirstChild("Humanoid"). But that depends on usage case.
This discussion is preserved as it was. New answers, comments, and votes are closed.

5 comments
wouldn't "Character:WaitForChild("Humanoid",10)" work better?
0hsa, basically no. There wouldn't be a reason to wait for humanoid every 10 seconds because humanoid is spawned in the character first.
They'll both point to humanoid, but there's no point in waiting since the character spawns in with the humanoid.
hey dude radiant_Light could u pls help me with a script ... plssss i really need ur help , dm me on discord xbloodyguyx#2156
Ask a question on this site. I'll answer if I can.