AbsentTobi20

Death animation

Jun 18th, 2021
802
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
  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)
RAW Paste Data