Advertisement
fireband12

Untitled

Mar 28th, 2015
343
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 5.34 KB | None | 0 0
  1. local Services = setmetatable({}, { __index = function(Self, Request) return game:getService(Request) or nil end })
  2. local Player = Services.Players.LocalPlayer
  3. local Backpack = Player:WaitForChild("Backpack")
  4. local Character = Player.Character
  5. local PlayerGui = Player:WaitForChild("PlayerGui")
  6. local Humanoid = Character:WaitForChild("Humanoid")
  7. local Head = Character:WaitForChild("Head")
  8. local RootPart = Character:WaitForChild("HumanoidRootPart")
  9. local Torso = Character:WaitForChild("Torso")
  10. local RightArm = Character:WaitForChild("Right Arm")
  11. local LeftArm = Character:WaitForChild("Left Arm")
  12. local RightLeg = Character:WaitForChild("Right Leg")
  13. local LeftLeg = Character:WaitForChild("Left Leg")
  14. local Neck = Torso:WaitForChild("Neck")
  15. local RightSH = Torso:WaitForChild("Right Shoulder")
  16. local LeftSH = Torso:WaitForChild("Left Shoulder")
  17. local RightHip = Torso:WaitForChild("Right Hip")
  18. local LeftHip = Torso:WaitForChild("Left Hip")
  19. local it = Instance.new
  20. local vt = Vector3.new
  21. local ang = Torso.CFrame * CFrame.Angles(0,-1.5,0)
  22. local cf = CFrame.new
  23. local angles = CFrame.Angles
  24. local euler = CFrame.fromEulerAnglesXYZ
  25. local UD2 = UDim2.new
  26. local bc = BrickColor.new
  27. local c3 = Color3.new
  28. local mouse = Player:GetMouse()
  29. local isAttacking = false
  30. function newPart(Parent, Name, Size) --- Would this work, all of the below C:?
  31. local nPart = it("Part")
  32. nPart.FormFactor = 3
  33. nPart.Name = Name
  34. nPart.Size = Size
  35. nPart.BottomSurface,TopSurface,RightSurface,LeftSurface,FrontSurface,BackSurface = 0, 0, 0, 0, 0, 0
  36. nPart.Parent = Parent
  37. return nPart
  38. end
  39.  
  40. function damage(player)
  41. local hit = false
  42. local dmg = math.random(1,10)
  43. if not hit then
  44. hit = true
  45. player:FindFirstChild('Humanoid'):TakeDamage(dmg)
  46. wait(3)
  47. hit = false
  48. end
  49. end
  50.  
  51.  
  52.  
  53. local staff = newPart(Character,"Yo",Vector3.new(0.5,5,0.5))
  54. staff.TopSurface = "Smooth"
  55. local RightSnap = it("Snap", Character)
  56. RightSnap.Part0 = Torso
  57. RightSnap.Part1 = RightArm
  58. RightSnap.C0 = cf(1.5,0.3,0) * angles(0,0,0.5)
  59. local LeftSnap = it("Snap", Character)
  60. LeftSnap.Part0 = Torso
  61. LeftSnap.Part1 = LeftArm
  62. LeftSnap.C0 = cf(-1.5,0.3,0) * angles(0,0,-0.5)
  63. local StaffSnap = it("Snap", Character)
  64. StaffSnap.Part0 = RightArm
  65. StaffSnap.Part1 = staff
  66. StaffSnap.C0 = CFrame.new(0,-0.7,0.5) * CFrame.Angles(-2.5,0,0)
  67.  
  68.  
  69. function lerp(a, b, t)
  70. return a + (b - a)*t
  71. end
  72.  
  73. local CFrameInterpolate=function(s,e,a,r,i,n,g)g,r=CFrame,{{s:toEulerAnglesXYZ()},{e:toEulerAnglesXYZ()}}for _=1,3 do i,n=r[1][_],r[2][_]r[1][_]=i+a*(n-i)end return(g.new(s.p:lerp(e.p,a))*g.Angles(unpack(r[1])))end
  74.  
  75.  
  76. function MainAttack()
  77. print('MainAttack initiated')
  78. local b = cf(0.3,0.3,-1) * angles(1.5,0,-1)
  79. local a = cf(1.5,0.3,0) * angles(0,0,0.5)
  80. local snapC0=RightSnap.C0;
  81. for index = 0,1,.01 do
  82. RightSnap.C0 = CFrameInterpolate(RightSnap.C0,b,.1)--// try index later
  83. game:service'RunService'.RenderStepped:wait();
  84. end
  85. wait(1)
  86. for index = 0,1,.01 do
  87. RightSnap.C0 = CFrameInterpolate(RightSnap.C0,a,.1)
  88. game:service'RunService'.RenderStepped:wait();
  89. end
  90. end
  91.  
  92. function freezePlr()
  93. for i = 0,1,.01 do
  94. game:GetService('RunService').RenderStepped:wait();
  95. RightSnap.C0 = CFrameInterpolate(RightSnap.C0,RightSnap.C0 * CFrame.Angles(0.5,0,0),.3)
  96. end
  97. fz = staff.Touched:connect(function(hit)
  98. if hit.Parent ~= nil and hit.Parent:FindFirstChild('Torso') then
  99. hit.Parent.Torso.Anchored = true
  100. end
  101. end)
  102. end
  103.  
  104. mouse.Button1Down:connect(function() if not isAttacking then isAttacking = true MainAttack() wait(1) isAttacking = false end end)
  105.  
  106. mouse.KeyDown:connect(function(key)
  107. key:lower()
  108.  
  109. if key == "f" and not isAttacking then
  110. isAttacking = true
  111. freezePlr()
  112. wait(2.5)
  113. isAttacking = false
  114. fz:disconnect()
  115. end
  116. end)
  117.  
  118.  
  119. local Point = LeftArm.CFrame
  120. local LastPoint = Point
  121.  
  122. while true do
  123. if Vector3.new(Torso.Velocity.x,0,Torso.Velocity.z).magnitude < 17 then
  124. Point = LeftArm.CFrame
  125. -- local variable so that the thread in Spawn refers to the cube that was just created
  126. local cube = newPart(LeftArm, "Hi", Vector3.new(1,1,1))
  127. local cube2 = newPart(LeftArm, "H", Vector3.new(0.5,0.5,0.5))
  128. cube.Anchored = true
  129. cube.BrickColor = BrickColor.new("Black")
  130. cube2.BrickColor = BrickColor.new("Really red")
  131. cube2.Anchored = true
  132. cube.CFrame = Point * CFrame.new(0,-2,0)
  133. cube2.CFrame = Point * CFrame.new(0,-2,0)
  134. cube.CanCollide = false
  135. cube2.CanCollide = false
  136. cube.TopSurface = "Smooth"
  137. cube2.TopSurface = "Smooth"
  138. for i = 1, 10 do
  139. cube.Transparency = cube.Transparency + 0.1
  140. cube2.Size = Vector3.new(i/3,i/3,i/3)
  141. cube2.Transparency = cube2.Transparency + 0.1
  142. wait()
  143. end
  144. if cube.Parent then -- if it still exists after the loop, destroy the cube.
  145. cube:Destroy()
  146. end
  147. if cube2.Parent then
  148. cube2:Destroy()
  149. end
  150. wait()
  151. LastPoint = Point
  152. end
  153. end
  154.  
  155.  
  156. --[[mouse.KeyDown:connect(function(key)
  157.  
  158. end)--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement