Advertisement
Guest User

Untitled

a guest
Feb 21st, 2020
119
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.93 KB | None | 0 0
  1. local tool = script.Parent
  2. local Anim1 = Instance.new("Animation")
  3. local Anim2 = Instance.new("Animation")
  4. local Anim3 = Instance.new("Animation")
  5. local Anim4 = Instance.new("Animation")
  6. Anim1.AnimationId = "rbxassetid://04707691579"
  7. Anim2.AnimationId = "rbxassetid://04707693196"
  8. Anim3.AnimationId = "rbxassetid://04707694337"
  9. Anim4.AnimationId = "rbxassetid://04707695605"
  10. local didpunch1 = false
  11. local didpunch2 = true
  12. local didkick1 = true
  13. local didkick2 = true
  14. local cooldown1 = 1.5
  15. local cooldown2 = 5 - cooldown1
  16. function attack(player)
  17. local Char = tool.Parent
  18. local Owner = tool:WaitForChild("Owner")
  19. local LAnim1 = Char.Humanoid:LoadAnimation(Anim1)
  20. local LAnim2 = Char.Humanoid:LoadAnimation(Anim2)
  21. local LAnim3 = Char.Humanoid:LoadAnimation(Anim3)
  22. local LAnim4 = Char.Humanoid:LoadAnimation(Anim4)
  23. Owner.Value = (tool.Parent.Name)
  24. if didpunch1 == false then
  25. local Damagescript1 = game.ServerStorage.DamageScript:Clone()
  26. Damagescript1.Parent = tool.Parent["Right Arm"]
  27. LAnim1:Play()
  28. didpunch1 = true
  29. wait(cooldown1)
  30. Damagescript1:Destroy()
  31. didpunch2 = false
  32. else
  33. if didpunch2 == false then
  34. local Damagescript2 = game.ServerStorage.DamageScript:Clone()
  35. Damagescript2.Parent = tool.Parent["Left Arm"]
  36. LAnim2:Play()
  37. didpunch2 = true
  38. wait(cooldown1)
  39. Damagescript2:Destroy()
  40. didkick1 = false
  41. else
  42. if didkick1 == false then
  43. local Damagescript3 = game.ServerStorage.DamageScript:Clone()
  44. Damagescript3.Parent = tool.Parent["Right Leg"]
  45. LAnim3:Play()
  46. didkick1 = true
  47. wait(cooldown1)
  48. Damagescript3:Destroy()
  49. didkick2 = false
  50. else
  51. if didpunch1 == false then
  52. local Damagescript4 = game.ServerStorage.DamageScript:Clone()
  53. Damagescript4.Parent = tool.Parent["Right Leg"]
  54. LAnim4:Play()
  55. didkick2 = true
  56. wait(cooldown1)
  57. Damagescript4:Destroy()
  58. wait(cooldown2)
  59. didpunch1 = false
  60. end
  61. end
  62. end
  63. end
  64. end
  65. script.Parent.Activated:Connect(attack)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement