Advertisement
YT_LegendBtw

Death Animation Script

Jan 12th, 2020
21,270
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.43 KB | None | 0 0
  1. wait()
  2. local Humanoid = script.Parent.Humanoid
  3. Humanoid.BreakJointsOnDeath = false
  4. local DA = Instance.new("Animation")
  5. DA.AnimationId = "rbxassetid://4545171410"
  6. local DeathAnimation = Humanoid:LoadAnimation(DA)
  7.  
  8. Humanoid.HealthChanged:Connect(function(Health)
  9. if Health <= 0 then
  10. print("died")
  11. script.Parent.HumanoidRootPart.Anchored = true
  12. DeathAnimation:Play()
  13. wait(2)
  14. script.Parent:Destroy()
  15.  
  16. end
  17. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement