Advertisement
Guest User

Untitled

a guest
Aug 27th, 2016
72
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 4.22 KB | None | 0 0
  1. local Player = game.Players.LocalPlayer
  2.  
  3. local sp=script.Parent
  4. local TheSword = Player.Character:FindFirstChild("Swordpack")
  5.  
  6. originalgrip=CFrame.new(.15,-1.8,0)*CFrame.Angles(0,0,0)
  7. currentgrip=originalgrip
  8.  
  9. sp.Grip=currentgrip
  10.  
  11. enabled=true
  12. taunting=false
  13.  
  14. function waitfor(parent,name)
  15. while true do
  16. local child=parent:FindFirstChild(name)
  17. if child~=nil then
  18. return child
  19. end
  20. wait()
  21. end
  22. end
  23.  
  24. waitfor(sp,"Handle")
  25.  
  26. function onButton1Down(mouse)
  27. if not enabled then
  28. return
  29. end
  30. enabled=false
  31. mouse.Icon="rbxasset://textures\\GunWaitCursor.png"
  32. wait(.75)
  33. mouse.Icon="rbxasset://textures\\GunCursor.png"
  34. enabled=true
  35. end
  36.  
  37. function swordUp()
  38. currentgrip=originalgrip
  39. end
  40.  
  41. function swordOut()
  42. currentgrip=originalgrip*CFrame.Angles(math.pi/4,.4,0)
  43. end
  44.  
  45. function spinsword(spintime)
  46. delay(0,function()
  47. local startspin=tick()
  48. local endspin=startspin+spintime
  49. while tick()<endspin do
  50. sp.Grip=currentgrip*CFrame.Angles(math.pi*2*((tick()-startspin)/spintime),0,0)
  51. wait()
  52. end
  53. sp.Grip=currentgrip
  54. end)
  55. end
  56.  
  57. function onEquippedLocal(mouse)
  58. if mouse==nil then
  59. print("Mouse not found")
  60. return
  61. end
  62. mouse.Icon="rbxasset://textures\\GunCursor.png"
  63. mouse.Button1Down:connect(function()
  64. onButton1Down(mouse)
  65. end)
  66. if TheSword:FindFirstChild("Part").Transparency == 0 then
  67. TheSword:FindFirstChild("Part").Transparency = 1
  68. end
  69. waitfor(sp,"Taunting")
  70. waitfor(sp,"Taunt")
  71. mouse.KeyDown:connect(function(key)
  72. key=string.lower(key)
  73. if key=="l" or key=="t" or key=="g" then -- :3
  74. local h=sp.Parent:FindFirstChild("Humanoid")
  75. if h~=nil then
  76. sp.Taunting.Value=true
  77. h.WalkSpeed=0
  78. local tauntanim=h:LoadAnimation(sp.Taunt)
  79. tauntanim:Play()
  80. wait(1)
  81. swordOut()
  82. sp.Grip=currentgrip
  83. wait(1.4)
  84. swordUp()
  85. sp.Grip=currentgrip
  86. wait(1)
  87. h.WalkSpeed=16
  88. sp.Taunting.Value=false
  89. end
  90. end
  91. end)
  92. end
  93. sp.Equipped:connect(onEquippedLocal)
  94.  
  95. sp.Unequipped:connect(function()
  96. if TheSword:FindFirstChild("Part").Transparency == 1 then
  97. TheSword:FindFirstChild("Part").Transparency = 0
  98. end
  99. end)
  100.  
  101. waitfor(sp,"RunAnim")
  102. sp.RunAnim.Changed:connect(function()
  103. local h=sp.Parent:FindFirstChild("Humanoid")
  104. local t=sp.Parent:FindFirstChild("Torso")
  105. local anim=sp:FindFirstChild(sp.RunAnim.Value)
  106. if anim and t and h then
  107. local theanim=h:LoadAnimation(anim)
  108. if theanim and h.Health>0 then
  109. theanim:Play()
  110. if sp.RunAnim.Value=="RightSlash" or sp.RunAnim.Value=="LeftSlash" or sp.RunAnim.Value=="OverHeadSwing" then
  111. spinsword(.5)
  112. end
  113. if sp.RunAnim.Value=="OverHeadSwing" then
  114. wait(.25)
  115. swordOut()
  116. wait(.5)
  117. swordUp()
  118. sp.Grip=currentgrip
  119. elseif sp.RunAnim.Value=="OverHeadSwingFast" then
  120. wait(.125)
  121. swordOut()
  122. wait(.25)
  123. swordUp()
  124. sp.Grip=currentgrip
  125. end
  126. end
  127. end
  128. end)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement