Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by
Elixcore 1337 Moderation Voter
5 years ago
event = script.Parent
plr = game.Players.LocalPlayer
plr.CharacterAdded:Wait()
hum = plr.Character:FindFirstChild("Humanoid")

1 answer

Log in to vote
0
Answered by
aazkao 787 Moderation Voter
5 years ago

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")

0
Yes wentman 19 — 5y
0
nope, tried this and numerous other methods. Elixcore 1337 — 5y
Ad

Answer this question