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

why is "hum" (Humanoid) nil? I simply cannot understand...

event = script.Parent
plr = game.Players.LocalPlayer
plr.CharacterAdded:Wait()
hum = plr.Character:FindFirstChild("Humanoid")

1 answer

The code runs before the humanoid loads. you can use WaitForChild to ensure that the humanoid loads before it assigns the variable

hum = plr.Character:WaitForChild("Humanoid")

2 comments

0

Yes

0

nope, tried this and numerous other methods.

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