Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- pcall(function() char.Animate:Destroy() end)
- SetWeld(RS,1,1,NV,NV,Vector3.new(1.5,0.5,0),NV)
- RS.C1 = CFrame.new(0,0.5,0)
- SetWeld(LS,1,1,NV,NV,Vector3.new(-1.5,0.5,0),NV)
- LS.C1 = CFrame.new(0,0.5,0)
- SetWeld(RH,1,1,NV,NV,Vector3.new(0.5,-1,0),NV)
- RH.C1 = CFrame.new(0,1,0)
- SetWeld(LH,1,1,NV,NV,Vector3.new(-0.5,-1,0),NV)
- LH.C1 = CFrame.new(0,1,0)
- SetWeld(N,1,1,NV,NV,Vector3.new(0,1,0),NV)
- N.C1 = CFrame.new(0,-0.5,0)
- SetWeld(HRJ,1,1,NV,NV,NV,NV)
- HRJ.C1 = CFrame.new(0,0,0)
- wait(1)
- RS.MaxVelocity = 0
- RS.CurrentAngle = 0
- RS.DesiredAngle = 0
- LS.MaxVelocity = 0
- LS.CurrentAngle = 0
- LS.DesiredAngle = 0
- RH.MaxVelocity = 0
- RH.CurrentAngle = 0
- RH.DesiredAngle = 0
- LH.MaxVelocity = 0
- LH.CurrentAngle = 0
- LH.DesiredAngle = 0
- N.MaxVelocity = 0
- N.CurrentAngle = 0
- N.DesiredAngle = 0
- HRJ.MaxVelocity = 0
- HRJ.CurrentAngle = 0
- HRJ.DesiredAngle = 0
- -----------------
- ----- value changed connections ----
- Main.Changed:connect(function()
- if Main.Value ~= nil then
- main,maina = GetWeld(Main.Value)
- else
- main,maina = nil,nil
- end
- end)
- Hu.Changed:connect(function()
- if disableJump or DisableMovement then
- Hu.Jump = false
- end
- end)
- ------- Keys & Mouse ---------------
- function B1D()
- MouseDown = true
- if not Animating then
- script.invoke.Value = 1
- else
- while Animating do
- wait()
- end
- if MouseDown then
- script.invoke.Value = 1
- end
- end
- end
- function B1U()
- MouseDown = false
- end
- mouse.Button1Down:connect(B1D)
- mouse.Button1Up:connect(B1U)
- function KD(key)
- if key == "0" then
- Shift = true
- if pose.Value == 1 then
- pose.Value = 0
- disableJump = false
- end
- elseif key == "4" then
- Alt = true
- if not Animating and SlideCooldown == 0 then
- invoke.Value = 3
- else
- while Animating or SlideCooldown > 0 do
- wait()
- end
- if Alt then
- invoke.Value = 3
- end
- end
- elseif key == "2" then
- if not ThrowingSequence then
- if pose.Value == 0 then
- pose.Value = 1
- disableJump = true
- elseif pose.Value == 1 then
- pose.Value = 0
- disableJump = false
- end
- end
- elseif key == string.char(32) then
- Space = true
- if pose.Value == 1 then
- if not Animating then
- invoke.Value = 2
- else
- while Animating do
- wait()
- end
- if Space and pose.Value == 1 then
- invoke.Value = 2
- end
- end
- end
- end
- end
- function KU(key)
- if key == "0" then
- Shift = false
- elseif key == "4" then
- Alt = false
- elseif key == string.char(32) then
- Space = false
- end
- end
- mouse.KeyDown:connect(KD)
- mouse.KeyUp:connect(KU)
- local count1 = 0
- local angle = 0
- local slidecount = 1
- local slidecountmax = 1
- local countspeed = 0.5
- local cancella = false
- local cancelra = false
- local cancelrl = false
- local cancelll = false
- local canceln = false
- local cancelhrp = false
- local cancelmain = false
- local anim = 0
- local lastanim = -1
- local lastpose = 0
- local rs,rsa, ls,lsa, rh,rha, lh,lha, n,na, hrj,hrja, main,maina
- local ghitz,genz
- local prevvelocity = HRP.Velocity
- function UpdateWP(max,sped)
- max = max or 5
- sped = sped or AnimSpeeds[anim+1]
- rs,rsa = GetWeld(RS)
- ls,lsa = GetWeld(LS)
- rh,rha = GetWeld(RH)
- lh,lha = GetWeld(LH)
- n,na = GetWeld(N)
- hrj,hrja = GetWeld(HRJ)
- if Main.Value ~= nil then
- main,maina = GetWeld(Main.Value)
- end
- slidecount = 0
- slidecountmax = max
- countspeed = sped
- end
- UpdateWP()
- -------------- Invoke Animations -------------------------
- function Throw()
- if not Animating and snowballs.Value > 0 then
- Animating = true
- ThrowingSequence = true
- pose.Value = 0
- disableJump = false
- ----- sword slash ------
- cancelra = true
- cancella = true
- cancelhrp = true
- canceln = true
- cancelmain = true
- local prevslidecount = slidecount
- UpdateWP(slidecountmax,countspeed)
- slidecount = prevslidecount
- local phase = 0
- local smdl = Instance.new("Model",char)
- smdl.Name = "SnowBall"
- local ball,weld
- for i = 1, 17 do
- if MouseDown then
- if i <= 7 then
- SetWeld(N,i,7,n,na,Vector3.new(0,1,0),Vector3.new(-0.3,-math.pi/8,0))
- SetWeld(HRJ,i,7,hrj,hrja,Vector3.new(0,0,0.1),Vector3.new(0,-math.pi/20,0))
- SetWeld(RS,i,7,rs,rsa,Vector3.new(1.5,0.26,0),Vector3.new(-0.2,0,-0.1))
- SetWeld(LS,i,7,ls,lsa,Vector3.new(-1.5,0.525,-0.01),Vector3.new(-0.25,0,-0.12))
- phase = 1
- if i == 7 then
- UpdateWP(slidecountmax,countspeed)
- ChangeValue(snowballs,"Increment",-1)
- ball = P:Clone()
- ball.Parent = smdl
- ball.BrickColor = BrickColor.new("White")
- ball.Material = "Sand"
- local mesh = Instance.new("SpecialMesh",ball)
- mesh.MeshType = "Sphere"
- mesh.Scale = Vector3.new(0.8,0.8,0.8) *5
- weld = Instance.new("Weld",ball)
- weld.Part0 = RA
- weld.Part1 = ball
- weld.C0 = CFrame.new(0,-1.3,0)
- end
- else
- SetWeld(N,i-7,10,n,na,Vector3.new(0,1,0),Vector3.new(0.03,math.pi/9,0))
- SetWeld(HRJ,i-7,10,hrj,hrja,Vector3.new(0,0,0.1),Vector3.new(0,-math.pi/8,0))
- SetWeld(RS,i-7,10,rs,rsa,Vector3.new(1.4,0.5,0),Vector3.new(math.pi*1.05,0,0.2))
- SetWeld(LS,i-7,10,ls,lsa,Vector3.new(-1.3,0.42,-0.1),Vector3.new(math.pi/4,0,-math.pi/8))
- if i == 9 then
- SPC.Archivable = true
- SPB.BackgroundColor3 = Color3.new(0.45,0.1,0.01)
- SPF.BackgroundColor3 = Color3.new(0.65,0.1,0.01)
- SPF.Size = UDim2.new(1,0,0,0)
- SPF.Position = UDim2.new(0,0,1,0)
- end
- phase = 2
- end
- wait(0.02)
- end
- end
- local rs2,rsa2 = GetWeld(RS)
- local ls2,lsa2 = GetWeld(LS)
- local n2,na2 = GetWeld(N)
- local hrj2,hrja2 = GetWeld(HRJ)
- local powercounter = 20
- local power = 0
- while MouseDown do
- powercounter = (powercounter%40) + 1
- power = 1 - math.sin(math.pi/40*powercounter)
- SPB.BackgroundColor3 = Color3.new((1-power)*0.35 +0.1,power*0.35 +0.1,0.01)
- SPF.BackgroundColor3 = Color3.new((1-power)*0.55 +0.1,power*0.55 +0.1,0.01)
- SPF.Size = UDim2.new(1,0,power,0)
- SPF.Position = UDim2.new(0,0,1-power,0)
- SetWeld(RS,power,1,rs2,rsa2,Vector3.new(1.4,0.6,0.05),Vector3.new(math.pi*1.17,0,0.3))
- SetWeld(LS,power,1,ls2,lsa2,Vector3.new(-1.3,0.42,-0.16),Vector3.new(math.pi/2.45,0,-math.pi/5))
- SetWeld(N,power,1,n2,na2,Vector3.new(0,1,0),Vector3.new(0.07,math.pi/8,-0.04))
- SetWeld(HRJ,power,1,hrj2,hrja2,Vector3.new(0,0,0.1),Vector3.new(0,-math.pi/7,0))
- phase = 3
- wait(0.02)
- end
- SPC.Archivable = false
- print("Phase:",phase)
- rs2,rsa2 = GetWeld(RS)
- ls2,lsa2 = GetWeld(LS)
- n2,na2 = GetWeld(N)
- hrj2,hrja2 = GetWeld(HRJ)
- if phase == 1 or phase == 2 then
- smdl:Destroy()
- ChangeValue(snowballs,"Increment",1)
- elseif phase == 3 then
- print("Throwing with "..string.sub(tostring(power*100),1,5).."% power!")
- local mousepos = mouse.Hit.p
- for i = 1, 8 do
- SetWeld(RS,i,8,rs2,rsa2,Vector3.new(1.4,0.6,0.05),Vector3.new((math.pi*0.6) -(1.8*power),0.18 - (0.65*power),0.3))
- SetWeld(LS,i,8,ls2,lsa2,Vector3.new(-1.36,0.5,-0.06),Vector3.new((-math.pi/4) - (0.4*power),0.2,-math.pi/5))
- SetWeld(N,i,8,n2,na2,Vector3.new(0,1,0),Vector3.new(-0.07,-math.pi/11 - (0.3*power),-0.04))
- SetWeld(HRJ,i,8,hrj2,hrja2,Vector3.new(0,0,0.1),Vector3.new(0,(math.pi/10)+(0.3*power),0))
- if i == 2 then
- weld:Destroy()
- ball.Anchored = true
- --- {part,gravity,currentgravity,direction,speed,power,counter,{parts},life}
- local snowball = {ball,0.1 + 0.8*(0.96-power),1 - (0.95*power),(mousepos-ball.Position).unit,1.8 + (3*power),power,1,{},0}
- if power > 0.99 then
- for i = 1, 20 do
- local p = P:Clone()
- p.Anchored = true
- p.BrickColor = BrickColor.new("Bright yellow")
- local mesh = Instance.new("SpecialMesh",p)
- mesh.MeshId = "rbxassetid://9756362"
- mesh.Scale = Vector3.new(0.32,0.32,0.32)
- table.insert(snowball[8],p)
- end
- end
- table.insert(SnowballProjectiles,snowball)
- end
- wait(0.02)
- end
- wait(0.02)
- else
- smdl:Destroy()
- end
- UpdateWP(slidecountmax,countspeed)
- cancelra = false
- cancella = false
- cancelhrp = false
- canceln = false
- cancelmain = false
- ThrowingSequence = false
- Animating = false
- elseif snowballs.Value <= 0 then
- print("No snow left!")
- -- alert saying you have no snow left in pouch
- end
- end
- function DiveRoll()
- if not Animating then
- Animating = true
- DisableMovement = true
- cancelra = true
- cancella = true
- cancelhrp = true
- canceln = true
- cancelmain = true
- cancelll = true
- cancelrl = true
- local prevslidecount = slidecount
- UpdateWP(slidecountmax,countspeed)
- slidecount = prevslidecount
- local bv = Instance.new("BodyVelocity", HRP)
- bv.maxForce = Vector3.new(1/0,0,1/0)
- bv.velocity = CFrame.new(NV,Vector3.new(HRP.CFrame.lookVector.x,0,HRP.CFrame.lookVector.z)).lookVector * 28
- local bg = Instance.new("BodyGyro", HRP)
- bg.maxTorque = Vector3.new(1/0,1/0,1/0)
- bg.cframe = CFrame.new(NV,Vector3.new(HRP.CFrame.lookVector.x,0,HRP.CFrame.lookVector.z))
- bg.D = 100
- game:GetService("Debris"):AddItem(bv,2.5)
- game:GetService("Debris"):AddItem(bg,2.5)
- local connex = game:GetService("RunService").RenderStepped:connect(function()
- if HRP.Velocity.y > 0 then
- HRP.Velocity = NV
- end
- HRP.CanCollide = false
- end)
- local connex2 = game:GetService("RunService").Stepped:connect(function()
- local Ghitz,Genz = RAY(HRP.Position,Vector3.new(0,-3.1,0))
- if Ghitz then
- HRP.CFrame = (HRP.CFrame - HRP.Position) + Genz + Vector3.new(0,3,0)
- end
- end)
- local animspd = 4
- for i = 1, animspd do
- SetWeld(N,i,animspd,n,na,Vector3.new(0,1,0),Vector3.new(math.pi/5,0,0),0)
- SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,0.4,0),Vector3.new(-math.pi/2.6,0,0),0)
- SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/1.2,0,0.2),0)
- SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/1.2,0,-0.2),0)
- SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,-0.6,-0.1),Vector3.new(0.1,0,0.05),0)
- SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,-0.6,-0.1),Vector3.new(0.1,0,-0.05),0)
- wait(0.02)
- end
- UpdateWP(slidecountmax,countspeed)
- for i = 1, animspd do
- SetWeld(N,i,animspd,n,na,Vector3.new(0,1,0),Vector3.new(math.pi/12,0,0),0)
- SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-0.7,0),Vector3.new(-math.pi/1.5,0,0),0)
- SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.6,-0.06),Vector3.new(math.pi/1.3,0,0.2),0)
- SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.6,-0.06),Vector3.new(math.pi/1.3,0,-0.2),0)
- SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,-1,0),Vector3.new(-0.1,0,0.05),0)
- SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,-1,0),Vector3.new(-0.1,0,-0.05),0)
- wait(0.02)
- end
- UpdateWP(slidecountmax,countspeed)
- for i = 1, animspd do
- SetWeld(N,i,animspd,n,na,Vector3.new(0,0.85,0),Vector3.new(-math.pi/4,0,0),0)
- SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-1,0),Vector3.new(-math.pi*0.9,0,0),0)
- SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/1.4,0,0.08),0)
- SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/1.4,0,-0.08),0)
- SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,-0.3,-0.4),Vector3.new(-0.12,0,0.05),0)
- SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,-0.3,-0.4),Vector3.new(-0.12,0,-0.05),0)
- wait(0.02)
- end
- UpdateWP(slidecountmax,countspeed)
- bv.velocity = bv.velocity * 0.9
- for i = 1, animspd do
- SetWeld(N,i,animspd,n,na,Vector3.new(0,0.85,0),Vector3.new(-math.pi/3.5,0,0),0)
- SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-1.25,0),Vector3.new(-math.pi*1.1,0,0),0)
- SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/1.8,0,-0.1),0)
- SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/1.8,0,0.1),0)
- SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,0.2,-0.7),Vector3.new(-0.12,0,0.05),0)
- SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,0.2,-0.7),Vector3.new(-0.12,0,-0.05),0)
- wait(0.02)
- end
- UpdateWP(slidecountmax,countspeed)
- for i = 1, animspd do
- SetWeld(N,i,animspd,n,na,Vector3.new(0,0.85,0),Vector3.new(-math.pi/3.7,0,0),0)
- SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-2.3,0),Vector3.new(-math.pi*1.55,0,0),0)
- SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/2.4,0,-0.23),0)
- SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/2.4,0,0.23),0)
- SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,0.1,-0.7),Vector3.new(-0.1,0,0.04),0)
- SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,0.1,-0.7),Vector3.new(-0.1,0,-0.04),0)
- wait(0.02)
- end
- UpdateWP(slidecountmax,countspeed)
- bv.velocity = bv.velocity * 0.7
- for i = 1, animspd do
- SetWeld(N,i,animspd,n,na,Vector3.new(0,1.05,0),Vector3.new(-0.4,0,0),0)
- SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-1.6,0),Vector3.new(-math.pi*1.85,0,0),0)
- SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.4,0.5,-0.06),Vector3.new(math.pi/3.2,0,-0.24),0)
- SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.4,0.5,-0.06),Vector3.new(math.pi/3.2,0,0.24),0)
- SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.5,-0.08,-0.6),Vector3.new(-0.22,0,0.04),0)
- SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.5,-0.08,-0.6),Vector3.new(-0.22,0,-0.04),0)
- wait(0.02)
- end
- UpdateWP(slidecountmax,countspeed)
- bv.velocity = bv.velocity * 0.4
- for i = 1, animspd do
- SetWeld(RS,i,animspd,rs,rsa,Vector3.new(1.35,0.66 + (angle*0.012),0.12),Vector3.new(0.2 + (angle*0.02),-0.22,0.446 + (angle*0.016)),0)
- SetWeld(LS,i,animspd,ls,lsa,Vector3.new(-1.35,0.66 + (angle*0.012),0.12),Vector3.new(0.2 + (angle*0.02),0.22,-0.446 - (angle*0.016)),0)
- SetWeld(RH,i,animspd,rh,rha,Vector3.new(0.7,-0.18 - (cangle*0.04),-0.2 - (angle*0.01)),Vector3.new(0.2 - (angle*0.12),-math.pi/5,0.12 - (angle*0.06)),0)
- SetWeld(LH,i,animspd,lh,lha,Vector3.new(-0.38,-0.32 + (cangle*0.04),-0.45 + (angle*0.01)),Vector3.new(-0.1 + (angle*0.15),-math.pi/5,-0.07 + (angle*0.07)),0)
- SetWeld(N,i,animspd,n,na,Vector3.new(0,1,0),Vector3.new(0.12 + (angle*0.004),-math.pi/5 - (angle*0.01),0.1),0)
- SetWeld(HRJ,i,animspd,hrj,hrja,Vector3.new(0,-0.7,0),Vector3.new((-math.pi*2) -0.24 + (-angle*0.008),math.pi/5 + (angle*0.01),angle*0.01),0)
- wait(0.02)
- end
- SetWeld(HRJ,1,1,hrj,hrja,Vector3.new(0,-0.7,0),Vector3.new(-0.24 + (-angle*0.008),math.pi/5 + (angle*0.01),angle*0.01))
- bv:Destroy()
- bg:Destroy()
- connex:disconnect()
- connex2:disconnect()
- UpdateWP()
- cancelra = false
- cancella = false
- cancelhrp = false
- canceln = false
- cancelmain = false
- cancelll = false
- cancelrl = false
- Animating = false
- DisableMovement = false
- end
- end
- function Slide()
- if not Animating and Shift and pose.Value == 0 and SlideCooldown == 0 and Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude >= 18 then
- Animating = true
- DisableMovement = true
- cancelra = true
- cancella = true
- cancelhrp = true
- canceln = true
- cancelmain = true
- cancelll = true
- cancelrl = true
- local prevslidecount = slidecount
- UpdateWP(slidecountmax,countspeed)
- slidecount = prevslidecount
- local bv = Instance.new("BodyVelocity", HRP)
- bv.maxForce = Vector3.new(1/0,0,1/0)
- bv.velocity = CFrame.new(NV,Vector3.new(HRP.CFrame.lookVector.x,0,HRP.CFrame.lookVector.z)).lookVector * 30
- local bg = Instance.new("BodyGyro", HRP)
- bg.maxTorque = Vector3.new(1/0,1/0,1/0)
- bg.cframe = CFrame.new(NV,Vector3.new(HRP.CFrame.lookVector.x,0,HRP.CFrame.lookVector.z))
- bg.D = 100
- game:GetService("Debris"):AddItem(bv,5.5)
- game:GetService("Debris"):AddItem(bg,5.5)
- local connex = game:GetService("RunService").RenderStepped:connect(function()
- if HRP.Velocity.y > 0 then
- HRP.Velocity = NV
- end
- HRP.CanCollide = false
- end)
- local animspd = 8
- local animcount = 1
- local bvaccel = 1
- local bvvelo = bv.velocity
- local lasttorpos = HRP.Position
- local tickcount = 0
- local cancelslide = false
- local torsoangle = 0
- while not cancelslide and bvaccel > 0.16 do
- tickcount = tickcount+1
- lasttorpos = HRP.Position
- animcount = (animcount < animspd and animcount+1) or animspd
- local n2,na2 = GetWeld(N)
- local hrj2,hrja2 = GetWeld(HRJ)
- local rs2,rsa2 = GetWeld(RS)
- local ls2,lsa2 = GetWeld(LS)
- local rh2,rha2 = GetWeld(RH)
- local lh2,lha2 = GetWeld(LH)
- SetWeld(N,1,4,n2,na2,Vector3.new(0,1.08,-0.1),Vector3.new(-math.pi/4.3,-0.12,-0.08))
- SetWeld(HRJ,1,4,hrj2,hrja2,Vector3.new(0,-2.1,0),Vector3.new((math.pi/2.6)+torsoangle,0.12 + (angle*0.008),0))
- SetWeld(RS,1,4,rs2,rsa2,Vector3.new(1.4,0.6,-0.02),Vector3.new(-math.pi/1.8,-(angle*0.01),0.2 - (angle*0.009)))
- SetWeld(LS,1,4,ls2,lsa2,Vector3.new(-1.3,0.6,-0.16),Vector3.new(-math.pi/1.8,-(angle*0.01),-0.6 - (angle*0.009)))
- SetWeld(RH,1,4,rh2,rha2,Vector3.new(0.5,-0.8,0),Vector3.new(0.22,-0.06 - (angle*0.01),0.05))
- SetWeld(LH,1,4,lh2,lha2,Vector3.new(-0.5,-0.35,-0.45),Vector3.new(-0.25,-0.12 - (angle*0.01),-0.03))
- bv.velocity = bvvelo * bvaccel
- wait(0.02)
- local torsoatan = (CFrame.new(lasttorpos) * (HRP.CFrame-HRP.Position)):pointToObjectSpace(HRP.Position)
- torsoangle = math.atan2(torsoatan.y,-torsoatan.z)
- local Ghitz,Genz = RAY(HRP.Position,Vector3.new(0,-3.1,0))
- if Ghitz then
- HRP.CFrame = (HRP.CFrame - HRP.Position) + Genz + Vector3.new(0,3,0)
- end
- if (lasttorpos.y - HRP.Position.y) < -0.1 then
- bvaccel = bvaccel - 0.045
- elseif (lasttorpos.y - HRP.Position.y) > 0.08 then
- bvaccel = bvaccel - 0.006
- if Ghitz then
- bvaccel = bvaccel + ((lasttorpos.y - HRP.Position.y) /2.5)
- end
- else
- bvaccel = bvaccel - 0.017
- end
- bvaccel = bvaccel > 1.02 and 1.02 or bvaccel
- local chitz,cenz = RAY(Torsoz.Position,Vector3.new(0,2.5,0))
- local stationary = false
- if tickcount > 5 then
- stationary = (Vector3.new(lasttorpos.x,0,lasttorpos.z) - Vector3.new(HRP.Position.x,0,HRP.Position.z)).magnitude < 0.15
- end
- if bvaccel < 0.16 or (chitz == nil and not Alt) or stationary then
- cancelslide = true
- end
- end
- SlideCooldown = 14
- bv:Destroy()
- bg:Destroy()
- connex:disconnect()
- UpdateWP(slidecountmax,countspeed)
- cancelra = false
- cancella = false
- cancelhrp = false
- canceln = false
- cancelmain = false
- cancelll = false
- cancelrl = false
- Animating = false
- DisableMovement = false
- end
- end
- invokelist = {}
- invokelist[1] = Throw
- invokelist[2] = DiveRoll
- invokelist[3] = Slide
- invoke.Changed:connect(function()
- if invoke.Value ~= 0 then
- local valu = invoke.Value
- invoke.Value = 0
- if invokelist[valu] ~= nil then
- invokelist[valu]()
- end
- end
- end)
- -------------- Animation Tween Funcs ----------------------
- function Idle()
- if script.pose.Value == 0 then
- ----- regular --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(-0.1 + (angle*0.027),0,0.046 - (angle*0.021)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(-0.1 + (angle*0.027),0,-0.046 + (angle*0.021)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-1,0),Vector3.new(-0.05 + (angle*0.018),0,0.01 - (angle*0.005)))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-1,0),Vector3.new(-0.05 + (angle*0.018),0,-0.01 + (angle*0.005)))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.04 + (-angle*0.02),0,0))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(0.016 + (-angle*0.009),0,0))
- end
- elseif script.pose.Value == 1 then
- ----- crouch --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.35,0.66 - (angle*0.012),0.12),Vector3.new(-0.1 + (angle*0.015),-0.22,0.446 - (angle*0.016)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.35,0.66 - (angle*0.012),0.12),Vector3.new(-0.1 + (angle*0.015),0.22,-0.446 + (angle*0.016)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.55,-1.05,-0.47 - (angle*0.006)),Vector3.new(-math.pi/2.2 + (angle*0.005),-math.pi/15,0.01 + (angle*0.005)))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,0.3,-0.55),Vector3.new(0.3 + (angle*0.01),-math.pi/12,0.08 + (angle*0.005)))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.12 + (angle*0.004),-math.pi/5,0.1))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,-1.4,0),Vector3.new(-0.16 + (-angle*0.007),math.pi/5,0))
- end
- elseif script.pose.Value == 2 then
- end
- end
- function Walking()
- if script.pose.Value == 0 then
- ----- regular --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(angle*0.2,0,-math.abs(angle*0.02)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(-angle*0.2,0,math.abs(angle*0.02)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-1,0),Vector3.new(-angle*0.17,0,math.abs(angle*0.005)))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-1,0),Vector3.new(angle*0.17,0,-math.abs(angle*0.005)))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.015 ,-angle*0.01,0))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.015 - math.abs((angle*0.02)),angle*0.01,0))
- end
- if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
- SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
- end
- elseif script.pose.Value == 1 then
- ----- crouch --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.35,0.66 + (angle*0.012),0.12),Vector3.new(0.2 + (angle*0.02),-0.22,0.446 + (angle*0.016)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.35,0.66 + (angle*0.012),0.12),Vector3.new(0.2 + (angle*0.02),0.22,-0.446 - (angle*0.016)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.7,-0.18 - (cangle*0.04),-0.2 - (angle*0.01)),Vector3.new(0.2 - (angle*0.12),-math.pi/5,0.12 - (angle*0.06)))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.38,-0.32 + (cangle*0.04),-0.45 + (angle*0.01)),Vector3.new(-0.1 + (angle*0.15),-math.pi/5,-0.07 + (angle*0.07)))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.12 + (angle*0.004),-math.pi/5 - (angle*0.01),0.1))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,-0.7,0),Vector3.new(-0.24 + (-angle*0.008),math.pi/5 + (angle*0.01),angle*0.01))
- end
- elseif script.pose.Value == 2 then
- end
- end
- function Running()
- if script.pose.Value == 0 then
- ----- regular --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5 - math.abs(angle*0.035),0.5 - math.abs(angle*0.02),0),Vector3.new(0.16 + (angle*0.42),0,-math.abs(angle*0.07)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5 + math.abs(angle*0.035),0.5 - math.abs(angle*0.02),0),Vector3.new(0.16 + (-angle*0.42),0,math.abs(angle*0.07)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-1 + math.abs(angle*0.05),0),Vector3.new(-angle*0.3,0,math.abs(angle*0.005)))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-1 + math.abs(angle*0.05),0),Vector3.new(angle*0.3,0,-math.abs(angle*0.005)))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.07 + math.abs(-angle*0.02),-angle*0.03,0))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.14 - math.abs(-angle*0.04),angle*0.035,NV))
- end
- if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
- SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
- end
- elseif script.pose.Value == 1 then
- elseif script.pose.Value == 2 then
- end
- end
- function Jumping()
- if script.pose.Value == 0 then
- ----- regular --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(-0.16,0,0.3 + (angle*0.012)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(-0.16,0,-0.3 - (angle*0.012)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-0.8,-0.05),Vector3.new(-0.28 + (angle*0.02),0,0))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-0.45,-0.55),Vector3.new(-0.4 - (angle*0.02),0,0))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.1,-angle*0.01,0))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(0.2 + (angle*0.002),angle*0.02,0))
- end
- if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
- SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
- end
- elseif script.pose.Value == 1 then
- ----- crouch --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(-0.16,0,0.3 + (angle*0.012)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(-0.16,0,-0.3 - (angle*0.012)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.7,-0.8,-0.05),Vector3.new(-0.28 + (angle*0.001),-math.pi/6,-0.2))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.3,-0.45,-0.55),Vector3.new(-0.4 - (angle*0.001),-math.pi/6,-0.2))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.1,-math.pi/5 - (angle*0.01),0))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.07 + (angle*0.002),math.pi/5 + (angle*0.02),0))
- end
- if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
- SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
- end
- elseif script.pose.Value == 2 then
- end
- end
- function Falling()
- if script.pose.Value == 0 then
- ----- regular --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.5,0),Vector3.new(math.pi*1.1,0,-0.08 + (angle*0.012)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.5,0),Vector3.new(math.pi*1.1,0,0.08 - (angle*0.012)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.5,-0.45,-0.55),Vector3.new(-0.4 + (angle*0.02),0,0))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.5,-0.8,-0.05),Vector3.new(-0.28 - (angle*0.02),0,0))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.1,-angle*0.01,0))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.2 + (angle*0.002),angle*0.02,0))
- end
- if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
- SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
- end
- elseif script.pose.Value == 1 then
- ----- crouch --------
- if not cancelra then
- SetWeld(RS,slidecount,slidecountmax,rs,rsa,Vector3.new(1.5,0.65,0),Vector3.new(-0.1,0,0.3 + (angle*0.012)))
- end
- if not cancella then
- SetWeld(LS,slidecount,slidecountmax,ls,lsa,Vector3.new(-1.5,0.65,0),Vector3.new(-0.1,0,-0.3 - (angle*0.012)))
- end
- if not cancelrl then
- SetWeld(RH,slidecount,slidecountmax,rh,rha,Vector3.new(0.8,-0.1,-0.25),Vector3.new(-0.28 + (angle*0.001),-math.pi/6,-0.2))
- end
- if not cancelll then
- SetWeld(LH,slidecount,slidecountmax,lh,lha,Vector3.new(-0.3,-0.8,-0.55),Vector3.new(-0.4 - (angle*0.001),-math.pi/6,-0.2))
- end
- if not canceln then
- SetWeld(N,slidecount,slidecountmax,n,na,Vector3.new(0,1,0),Vector3.new(0.1,-math.pi/5 - (angle*0.01),0))
- end
- if not cancelhrp then
- SetWeld(HRJ,slidecount,slidecountmax,hrj,hrja,Vector3.new(0,0,0),Vector3.new(-0.07 + (angle*0.002),math.pi/5 + (angle*0.02),0))
- end
- if not cancelmain and Main.Value ~= nil and main ~= nil and maina ~= nil then
- SetWeld(Main.Value,slidecount,slidecountmax,main,maina,Vector3.new(0,-1,0),NV)
- end
- elseif script.pose.Value == 2 then
- end
- end
- game:GetService("RunService").Stepped:connect(function()
- count1 = (count1%100) + countspeed
- angle = math.pi * math.sin(math.pi*2/100*count1)
- cangle = math.pi * math.cos(math.pi*2/100*count1)
- ------------- snowball power gui movement ------------------
- if SPC.Archivable == true then
- SPCP = SPCP ~= 14 and SPCP+1 or 14
- else
- SPCP = SPCP ~= 0 and SPCP-1 or 0
- end
- if SPC ~= nil then
- local perc = math.sin((math.pi/2/14)*SPCP)
- SPC.Position = UDim2.new(1,10 - (50*perc),0.5,-55)
- if SPCP > 0 then
- SPC.Visible = true
- else
- SPC.Visible = false
- end
- end
- ------------- walkspeed changes -------------------------
- if DisableMovement then
- Walkspeed = 0
- Hu.WalkSpeed = Walkspeed
- else
- if Shift and pose.Value ~= 1 then
- Walkspeed = 25
- Hu.WalkSpeed = Walkspeed
- else
- Walkspeed = 16
- if pose.Value == 1 then
- Hu.WalkSpeed = Walkspeed/2
- else
- Hu.WalkSpeed = Walkspeed
- end
- end
- end
- -------- animation slide count and pose smoothener --------------------
- slidecount = (slidecount < slidecountmax and slidecount+1) or slidecountmax
- SlideCooldown = (SlideCooldown > 0 and SlideCooldown-1) or 0
- if script.pose.Value ~= lastpose then
- UpdateWP()
- end
- --------- animation conditions -------------------
- local ghitz, genz = RAY(Torsoz.Position,Vector3.new(0,-5.2,0))
- if ghitz == nil and Torsoz.Velocity.y > 1 then
- ----- jumping -----
- anim = 3
- if anim ~= lastanim then
- UpdateWP(7)
- end
- Jumping()
- elseif ghitz == nil and Torsoz.Velocity.y < -1 then
- ----- falling ------
- anim = 4
- if anim ~= lastanim then
- UpdateWP(7)
- end
- Falling()
- elseif Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude < 2 then
- ---- idle ---------
- anim = 0
- if anim ~= lastanim then
- UpdateWP(6)
- end
- Idle()
- elseif Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude < 17 then
- ---- walking -------
- anim = 1
- if anim ~= lastanim then
- UpdateWP(7)
- end
- Walking()
- elseif Vector3.new(Torsoz.Velocity.x,0,Torsoz.Velocity.z).magnitude >= 17 then
- ----- running -----
- anim = 2
- if anim ~= lastanim then
- UpdateWP(5)
- end
- Running()
- ------------
- end
- --------- breakfall roll --------
- if ghitz ~= nil and prevvelocity.y < -110 then
- invoke.Value = 2
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement