Hello, does anyone know what is wrong?
I want an animation to play when the humanoid’s life reaches 0.
That way: the humanoid does not move from its position and play fall animation
Server Script:
if humanoid.Health <= 0 then
print('humanoid HP is <= 0')
local fallAnim = humanoid:LoadAnimation(script.fall)
fallAnim:Play()
print('Fall Animation has been played')
end
local fallAnim = humanoid:LoadAnimation(script.fall)
humanoid.BreakJointsOnDeath = false
humanoid.Died:Connect(function()
fallAnim:Play()
print('Fall Animation has been played')
end)
It works but after the animation is played the humanoid stays stiff with the tool in hand and not in the last position of the played animation, what is wrong with that?
local Health = Instance.new("NumberValue", player)
Health.Name = "Health"
Health.Value = 100
after that do something like
player.Health:GetPropertyChangedSignal("Value"):Connect()
if player.Health.Value == 0 then
print"Dead, but without ragdoll or stuff"
end
end)
don’t used humanoid health, it’s kinda annoying to deal with in many occasions…
with this variable you can change his health to anything you wish without ruining some physics or some weird stuff happening
humanoid.BreakJointsOnDeath = false
if humanoid.Health <= 0 then
print('humanoid HP is <= 0')
local fallAnim = humanoid:LoadAnimation(script.fall)
fallAnim:Play()
print('Fall Animation has been played')
end