error : LoadAnimation requires the Humanoid object to be descendant of the game object
local Players = game:GetService("Players")
Players.PlayerAdded:Connect(function(Plr)
Plr.CharacterAdded:Connect(
function(char)
print(char)
local Hum = char:WaitForChild("Humanoid")
print(Hum)
Hum:SetStateEnabled(Enum.HumanoidStateType.Dead, false)
DeathAnim = Hum:LoadAnimation(script.Parent.Reset)
Hum.HealthChanged:Connect(
function()
if Hum.Health <= 0 then
DeathAnim:Play()
end
end
)
DeathAnim.Stopped:Connect(
function()
Hum.Health = 0
Hum:SetStateEnabled(Enum.HumanoidStateType.Dead, true)
end
)
end)
end)
Gives error. Char > my username char.Parent > nil how to wait for character happen in workspace dont know, wait() on start somehow stops script
EDIT : you need to wait for character to appear in workspace, char.Parent is nil so humanoid isn't in game object, cant load animation, how to fix that idk

2 comments
whats the error?
The error is that she/he didn't insert a cooldown for the humanoid to load in.