Advertisement
Guest User

Untitled

a guest
Oct 31st, 2014
168
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.84 KB | None | 0 0
  1. local ply = game.Players.LocalPlayer
  2. local char = ply.Character
  3.  
  4. Animations = {"LeftSlash", "LeftSwingFast", "Stab1", "Stab2"}
  5.  
  6. AnimateModel = Instance.new("Model",char)
  7. AnimateModel.Name = "AnimationObjects"
  8. an = Instance.new("Animation", AnimateModel)
  9. an.AnimationId = "http://www.roblox.com/Asset?ID=74894663"
  10. an.Name = "LeftSlash"
  11. an2 = Instance.new("Animation", AnimateModel)
  12. an2.AnimationId = "http://www.roblox.com/Asset?ID=86313418"
  13. an2.Name = "LeftSwingFast"
  14. an3 = Instance.new("Animation", AnimateModel)
  15. an3.AnimationId = "http://www.roblox.com/Asset?ID=96559159"
  16. an3.Name = "Stab1"
  17. an4 = Instance.new("Animation", AnimateModel)
  18. an4.AnimationId = "http://www.roblox.com/Asset?ID=96559161"
  19. an4.Name = "Stab2"
  20. an5 = Instance.new("Animation", AnimateModel)
  21. an5.AnimationId = "http://www.roblox.com/Asset?ID=94160581"
  22. an5.Name = "Equip"
  23.  
  24. local Damage = 8.5
  25. local SwingTime = 0.5
  26. local LastSwing = tick()
  27. local IsEquipped = false
  28.  
  29. function GetRandomAnimation()
  30. local r = math.random(1,#Animations)
  31. local rng = Animations[r]
  32. return rng
  33. end
  34.  
  35. function MouseEvent()
  36. if (tick() - LastSwing) >= SwingTime then
  37. LastSwing = tick()
  38. if IsEquipped == true then
  39. local CurlAnim = GetRandomAnimation()
  40. if CurlAnim ~= nil then
  41. local Anim = char.Humanoid:LoadAnimation(char.AnimationObjects[CurlAnim])
  42. RunningAnim = Anim
  43. Anim:Play(nil,nil,1.2)
  44. coroutine.resume(coroutine.create(function()
  45. wait(0.5)
  46. if RunningAnim == Anim then
  47. Anim = nil
  48. end
  49. end))
  50. end
  51. end
  52. end
  53. end
  54.  
  55. function Equip(mouse)
  56. IsEquipped = true
  57. LastSwing = tick()
  58. mouse.Button1Down:connect(MouseEvent)
  59. wait(0.02)
  60. local Anim = char.Humanoid:LoadAnimation(char.AnimationObjects.Equip)
  61. RunningAnim = Anim
  62. Anim:Play(nil,nil,1.5)
  63. wait(1.3)
  64. end
  65.  
  66. function UnEquip()
  67. IsEquipped = false
  68. end
  69.  
  70. script.Parent.Equipped:connect(Equip)
  71. script.Parent.Unequipped:connect(UnEquip)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement