Advertisement
Guest User

Untitled

a guest
Jan 23rd, 2020
102
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.40 KB | None | 0 0
  1.  
  2.  
  3.  
  4.  
  5. Attack_Damage = {
  6.  
  7. Normal_Damage = 0, -- Put Damage Value Here
  8. Combo_2_Damage = 0, -- Put Damage Value Here
  9. Combo_3_Damage = 0, -- Put Damage Value Here
  10.  
  11. }
  12.  
  13. Animation = {
  14.  
  15. Idle = 0, -- Idle Anim id here
  16. Anim_1 = 0, -- Normall Attack Anim id here
  17. Anim_2 = 0, -- Combo 2 Attack Anim id here
  18. Anim_3 = 0, -- Combo 3 Attack Anim id here
  19.  
  20. }
  21.  
  22. Sounds = {
  23.  
  24. Swing1_Sound = 0, -- Sound Id here
  25. Swing2_Sound = 0, -- Sound Id here
  26. Idle_Sound = 0, --Sound Id here
  27.  
  28. }
  29.  
  30. db = true
  31.  
  32. function Hit(hit)
  33. humanoid = hit.Parent:WaitForChild("Humanoid") -- Humanoid
  34. end
  35.  
  36. function Attack()
  37. local Damage = Attack_Damage.Normal_Damage -- Defualt Damage
  38. local Sound1 = Sounds.Swing1_Sound:Play() -- Defuat Sound
  39. if db == true then
  40. db = false
  41. if humanoid then
  42. humanoid.Health = humanoid.Health - 10
  43. end
  44. end
  45. end
  46.  
  47. function Combo2()
  48. local Damage = Attack_Damage.Combo_2_Damage
  49. local Sound2 = Sounds.Swing2_Sound
  50.  
  51. if db == true then
  52. db = false
  53. if humanoid then
  54. humanoid.Health = humanoid.Health - 20
  55. end
  56.  
  57. end
  58. end
  59.  
  60. function Combo3()
  61. local Damage = Attack_Damage.Combo_3_Damage
  62. local Sound3 = Sounds.Swing2_Sound
  63.  
  64. if db == true then
  65. db = false
  66. if humanoid then
  67. humanoid.Health = humanoid.Health - 15
  68. end
  69.  
  70. end
  71. end
  72.  
  73.  
  74.  
  75.  
  76. local Tool = script.Parent
  77. local LastAttack = 0
  78.  
  79. function Activated()
  80. if not Tool.Enabled or not Tool.Equipped then
  81. return
  82. end
  83. Tool.Enabled = false -- Keep it false
  84. local Tk = game:GetService("RunService").Stepped:Wait()
  85. if (Tk - LastAttack < 0.2) then
  86. Combo2() -- The Attack you want it to do if it has attacked
  87. else
  88. Attack() -- Defualt Attack
  89. end
  90. LastAttack = Tk
  91. local Damage = Attack_Damage.Normal_Damage
  92. local Defualt_Anim = Animation.Anim_1 -- Defualt Animation
  93. local Combo2_Anim = Animation.Anim_2 -- Combo2 Animation
  94. Tool.Enabled = true
  95. end
  96.  
  97.  
  98.  
  99. function Equipped()
  100. local Character = Tool.Parent
  101. local Player = game.Players:GetPlayerFromCharacter(Character)
  102. local Humanoid = Character:FindFirstChildOfClass("Humanoid")
  103. local Torso = Character:FindFirstChild("Torso") or Character:FindFirstChild("HumanoidRootPart")
  104. if humanoid.Health == 0 then
  105. return
  106. end
  107. local db = true
  108. Sounds.Idle_Sound:Play()
  109. end
  110.  
  111. Tool.Activated:Connect(Activated)
  112. Tool.Equipped:Connect(Equipped)
  113.  
  114.  
  115. Connection = Tool.Blade.Touched:Connect(Hit) -- Make sure you have blade in your Sword
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement