So currently I have this script:
1 | Game.Players.PlayerAdded:connect( function (player) |
2 |
3 | while not player.Character do wait() end |
4 | local character = player.Character |
5 | local animateScript = character.Animate |
6 | animateScript.death.Animation 1. AnimationId = 'http://www.roblox.com/asset/?id=' |
7 | end ) |
Yeah I tried it and it doesn't work. It is probably the death part. Would anyone tell me how to make it so that when a player's health goes to 0 it plays the animation?
1 | function onDied() |
2 | --do your stuff |
3 | end |
4 |
5 | game.Players.LocalPlayer.Character.Humanoid.Died:connect(onDied) |
It's simple, really. There is a "died" event for humanoid.
I do not think that is possible as they always break joints what I'd suggest is making a fake health and when it hits 0 play an animation. then :LoadCharacter() after it finishes.