So I made 2 low hp animations: Running and idle but for some reason the running one is always playing, if hp goes back to more than 33% it stops tho, but the idle one is not working, I'll send the script if anyone can tell me wich part I should correct about it
local character = script.Parent
local humanoid = character:FindFirstChild("Humanoid")
local RunanimationId= "108538814490004"
local IdleanimationId= "127159591344032"
local loadedIdleAnimation = humanoid:LoadAnimation(IdleanimationId)
local loadedRunAnimatin = humanoid:LoadAnimation(RunanimationId)
while wait do
if humanoid.Health <= 33 then do
if Enum.HumanoidStateType.Idle then do
loadedRunAnimatin:Stop()
wait(0.5)
loadedIdleAnimation:Play()
loadedIdleAnimation.looped = true
end
if Enum.HumanoidStateType.Walking then do
loadedIdleAnimation:Stop()
wait(0.5)
loadedRunAnimatin:Play()
loadedRunAnimatin.looped = true
end
else do
end
end
end
loadedIdleAnimation:Stop()
loadedRunAnimatin:Stop()
end
end
end


** You are now Level 1! **