Hello everyone, I have a problem with a simple script that I made. Basically, if your health is below 1, it will play an animation, then reload the character. I tried to change the humanoid in game below 1, but nothing happens. Thank you for your help.
local plr = game.Players.LocalPlayer
local char = plr.Character
local humanoid = char.Humanoid
local animation = Instance.new("Animation")
animation.AnimationId = "rbxassetid://01360428041"
local track = humanoid:LoadAnimation(animation)
if humanoid.Health < 1 then
humanoid.WalkSpeed = 0
track:Play()
wait(5)
plr:LoadCharacter()
end

2 comments
below 1 is 0 so somehow you would have to prevent the death from actually accuring
Okay, ty