TheUnknownDiscord

minecraf

Feb 10th, 2022 (edited)
87
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 2.97 KB | None | 0 0
  1. _G.attackspeed = 0.09375
  2. local rightarm = Instance.new("Weld", owner.Character.Torso)
  3. rightarm.Part0 = owner.Character.Torso
  4. rightarm.Part1 = owner.Character["Right Arm"]
  5. rightarm.C0 = CFrame.new(1.5,0,0)
  6. rightarm.Name = "RightArmWeld"
  7. rightarm.Enabled = false
  8. tool = Instance.new("Tool",owner.Backpack)
  9. part = Instance.new("Part",tool)
  10. part.Name = "Handle"
  11. part.Size = Vector3.new(2.5,2.5,2.5)
  12. part.Shape = "Ball"
  13. part.Transparency = 1
  14. tool.Grip = CFrame.new(0,0,0.65)
  15. attacking = false
  16. local tweenService = game:GetService("TweenService")
  17. local timeToFade = attackspeed
  18. local object = rightarm
  19. local tweenInfo = TweenInfo.new(timeToFade,Enum.EasingStyle.Linear)
  20. local goal = {}
  21. goal.C0 = CFrame.new(1.75,0.35,-0.65) * CFrame.Angles(math.rad(80),0,0) * CFrame.Angles(0,0,math.rad(15))
  22.  
  23. local tween = tweenService:Create(object, tweenInfo, goal)
  24. tween:Play()
  25. local goal2 = {}
  26. goal2.C0 = CFrame.new(1.5,0.65,-0.65) * CFrame.Angles(math.rad(100),0,0) * CFrame.Angles(0,0,math.rad(0))
  27.  
  28. local tween2 = tweenService:Create(object, tweenInfo, goal2)
  29. tween2:Play()
  30. local goal3 = {}
  31. goal3.C0 = CFrame.new(1.25,0.35,-0.65) * CFrame.Angles(math.rad(80),0,0) * CFrame.Angles(0,0,math.rad(-15))
  32.  
  33. local tween3 = tweenService:Create(object, tweenInfo, goal3)
  34. tween3:Play()
  35. local goal4 = {}
  36. goal4.C0 = CFrame.new(1.5,0.125,-0.45) * CFrame.Angles(math.rad(50),0,0)
  37.  
  38. local tween4 = tweenService:Create(object, tweenInfo, goal4)
  39. tween4:Play()
  40. local goal5 = {}
  41. goal5.C0 = CFrame.new(1.5,0,0)
  42.  
  43. local tween5 = tweenService:Create(object, tweenInfo, goal5)
  44. tween5:Play()
  45. tween.Completed:Connect(function()tween2:Play() end)
  46. tween2.Completed:Connect(function()tween3:Play() end)
  47. tween3.Completed:Connect(function()tween4:Play() end)
  48. tween4.Completed:Connect(function()
  49. if not attacking then
  50. tween5:Play()
  51. else
  52. tween:Play()
  53. end
  54. end)
  55. tween5.Completed:Connect(function()
  56. rightarm.Enabled = false
  57. end)
  58. tool.Activated:Connect(function()
  59. attacking = true
  60. tween:Play()
  61. rightarm.Enabled = true
  62. end)
  63. tool.Deactivated:Connect(function()
  64. attacking = false
  65. end)
  66. local db = false
  67. part.Touched:Connect(function(hit)
  68. pcall(function()
  69. if attacking then
  70. if hit.Parent ~= owner.Character then
  71. if hit.Parent:FindFirstChildWhichIsA("Humanoid") then
  72. if not db then
  73. db = true
  74. hit.Parent:FindFirstChildWhichIsA("Humanoid").Health -= 10
  75. for i,c in pairs(hit.Parent:GetDescendants()) do
  76. pcall(function()
  77. if c:IsA("Part") then
  78. local v = Instance.new("SpawnLocation")
  79. v.CFrame = c.CFrame
  80. v.Enabled = false
  81. if c:FindFirstChildWhichIsA("SpecialMesh") then
  82. local m = c:FindFirstChildWhichIsA("SpecialMesh"):Clone()
  83. m.Parent = v
  84. m.Scale = m.Scale + Vector3.new(0.1,0.1,0.1)
  85. end
  86. v.Size = c.Size + Vector3.new(0.1,0.1,0.1)
  87. v.Transparency = 0.65
  88. v.Color = Color3.new(1,0,0)
  89. v.CanCollide = false
  90. v.Parent = script
  91. local weld = Instance.new("Weld",c)
  92. weld.Part0 = v
  93. weld.Part1 = c
  94. game:GetService("Debris"):AddItem(v,0.125)
  95. end
  96. end)
  97. end
  98. wait(attackspeed)
  99. db = false
  100. end
  101. end
  102. end
  103. end
  104. end)
  105. end)
Add Comment
Please, Sign In to add comment