Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

How do I reference a players Humanoid when they join the game?

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?

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.

5 comments

0

wouldn't "Character:WaitForChild("Humanoid",10)" work better?

0

0hsa, basically no. There wouldn't be a reason to wait for humanoid every 10 seconds because humanoid is spawned in the character first.

0

They'll both point to humanoid, but there's no point in waiting since the character spawns in with the humanoid.

0

hey dude radiant_Light could u pls help me with a script ... plssss i really need ur help , dm me on discord xbloodyguyx#2156

0

Ask a question on this site. I'll answer if I can.

This discussion is preserved as it was. New answers, comments, and votes are closed.