Guest User

Untitled

a guest
Apr 26th, 2017
78
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.76 KB | None | 0 0
  1. local sword = script.Parent
  2. local handle = sword:WaitForChild("Handle")
  3.  
  4. Sounds = {{145180529, "Slash"}, {145180550, "Slash"}}
  5.  
  6. function attack()
  7. if not enabled then
  8. return
  9. end
  10. local humanoid = sword.Parent.Humanoid
  11. local sound = handle:WaitForChild("Sounds"):GetChildren()
  12.  
  13. sound[math.random(#sound)]:Play()
  14.  
  15. Tool.Enabled = true
  16.  
  17. function onActivated()
  18.  
  19. if not Tool.Enabled then return end
  20.  
  21. Tool.Enabled = false
  22.  
  23. local character = Tool.Parent;
  24. local humanoid = character.Humanoid
  25.  
  26. if humanoid == nil then return end
  27.  
  28. wait(1)
  29.  
  30. Tool.Enabled = true
  31. end
  32.  
  33. script.Parent.Activated:Connect(onActivated)
  34. end
Add Comment
Please, Sign In to add comment