Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- local Services = setmetatable({}, { __index = function(Self, Request) return game:getService(Request) or nil end })
- local Player = Services.Players.LocalPlayer
- local Backpack = Player:WaitForChild("Backpack")
- local Character = Player.Character
- local PlayerGui = Player:WaitForChild("PlayerGui")
- local Humanoid = Character:WaitForChild("Humanoid")
- local Head = Character:WaitForChild("Head")
- local RootPart = Character:WaitForChild("HumanoidRootPart")
- local Torso = Character:WaitForChild("Torso")
- local RightArm = Character:WaitForChild("Right Arm")
- local LeftArm = Character:WaitForChild("Left Arm")
- local RightLeg = Character:WaitForChild("Right Leg")
- local LeftLeg = Character:WaitForChild("Left Leg")
- local Neck = Torso:WaitForChild("Neck")
- local RightSH = Torso:WaitForChild("Right Shoulder")
- local LeftSH = Torso:WaitForChild("Left Shoulder")
- local RightHip = Torso:WaitForChild("Right Hip")
- local LeftHip = Torso:WaitForChild("Left Hip")
- local it = Instance.new
- local vt = Vector3.new
- local ang = Torso.CFrame * CFrame.Angles(0,-1.5,0)
- local cf = CFrame.new
- local angles = CFrame.Angles
- local euler = CFrame.fromEulerAnglesXYZ
- local UD2 = UDim2.new
- local bc = BrickColor.new
- local c3 = Color3.new
- local mouse = Player:GetMouse()
- local isAttacking = false
- function newPart(Parent, Name, Size) --- Would this work, all of the below C:?
- local nPart = it("Part")
- nPart.FormFactor = 3
- nPart.Name = Name
- nPart.Size = Size
- nPart.BottomSurface,TopSurface,RightSurface,LeftSurface,FrontSurface,BackSurface = 0, 0, 0, 0, 0, 0
- nPart.Parent = Parent
- return nPart
- end
- function damage(player)
- local hit = false
- local dmg = math.random(1,10)
- if not hit then
- hit = true
- player:FindFirstChild('Humanoid'):TakeDamage(dmg)
- wait(3)
- hit = false
- end
- end
- local staff = newPart(Character,"Yo",Vector3.new(0.5,5,0.5))
- staff.TopSurface = "Smooth"
- local RightSnap = it("Snap", Character)
- RightSnap.Part0 = Torso
- RightSnap.Part1 = RightArm
- RightSnap.C0 = cf(1.5,0.3,0) * angles(0,0,0.5)
- local LeftSnap = it("Snap", Character)
- LeftSnap.Part0 = Torso
- LeftSnap.Part1 = LeftArm
- LeftSnap.C0 = cf(-1.5,0.3,0) * angles(0,0,-0.5)
- local StaffSnap = it("Snap", Character)
- StaffSnap.Part0 = RightArm
- StaffSnap.Part1 = staff
- StaffSnap.C0 = CFrame.new(0,-0.7,0.5) * CFrame.Angles(-2.5,0,0)
- function lerp(a, b, t)
- return a + (b - a)*t
- end
- 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
- function MainAttack()
- print('MainAttack initiated')
- local b = cf(0.3,0.3,-1) * angles(1.5,0,-1)
- local a = cf(1.5,0.3,0) * angles(0,0,0.5)
- local snapC0=RightSnap.C0;
- for index = 0,1,.01 do
- RightSnap.C0 = CFrameInterpolate(RightSnap.C0,b,.1)--// try index later
- game:service'RunService'.RenderStepped:wait();
- end
- wait(1)
- for index = 0,1,.01 do
- RightSnap.C0 = CFrameInterpolate(RightSnap.C0,a,.1)
- game:service'RunService'.RenderStepped:wait();
- end
- end
- function freezePlr()
- for i = 0,1,.01 do
- game:GetService('RunService').RenderStepped:wait();
- RightSnap.C0 = CFrameInterpolate(RightSnap.C0,RightSnap.C0 * CFrame.Angles(0.5,0,0),.3)
- end
- fz = staff.Touched:connect(function(hit)
- if hit.Parent ~= nil and hit.Parent:FindFirstChild('Torso') then
- hit.Parent.Torso.Anchored = true
- end
- end)
- end
- mouse.Button1Down:connect(function() if not isAttacking then isAttacking = true MainAttack() wait(1) isAttacking = false end end)
- mouse.KeyDown:connect(function(key)
- key:lower()
- if key == "f" and not isAttacking then
- isAttacking = true
- freezePlr()
- wait(2.5)
- isAttacking = false
- fz:disconnect()
- end
- end)
- local Point = LeftArm.CFrame
- local LastPoint = Point
- while true do
- if Vector3.new(Torso.Velocity.x,0,Torso.Velocity.z).magnitude < 17 then
- Point = LeftArm.CFrame
- -- local variable so that the thread in Spawn refers to the cube that was just created
- local cube = newPart(LeftArm, "Hi", Vector3.new(1,1,1))
- local cube2 = newPart(LeftArm, "H", Vector3.new(0.5,0.5,0.5))
- cube.Anchored = true
- cube.BrickColor = BrickColor.new("Black")
- cube2.BrickColor = BrickColor.new("Really red")
- cube2.Anchored = true
- cube.CFrame = Point * CFrame.new(0,-2,0)
- cube2.CFrame = Point * CFrame.new(0,-2,0)
- cube.CanCollide = false
- cube2.CanCollide = false
- cube.TopSurface = "Smooth"
- cube2.TopSurface = "Smooth"
- for i = 1, 10 do
- cube.Transparency = cube.Transparency + 0.1
- cube2.Size = Vector3.new(i/3,i/3,i/3)
- cube2.Transparency = cube2.Transparency + 0.1
- wait()
- end
- if cube.Parent then -- if it still exists after the loop, destroy the cube.
- cube:Destroy()
- end
- if cube2.Parent then
- cube2:Destroy()
- end
- wait()
- LastPoint = Point
- end
- end
- --[[mouse.KeyDown:connect(function(key)
- end)--]]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement