event = script.Parent plr = game.Players.LocalPlayer plr.CharacterAdded:Wait() hum = plr.Character:FindFirstChild("Humanoid")
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")