Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --By Rufus14
- --owner = game:GetService("Players"):GetPlayerFromCharacter(script.Parent)
- character = owner.Character
- NLS([[
- --By Rufus14
- owner = game:GetService("Players").LocalPlayer
- local ownerhead = owner.Character:WaitForChild("Head")
- parkietremote = owner.Character:WaitForChild("parkietremote")
- mouse = owner:GetMouse()
- local part = Instance.new("Part", owner.Character.Head)
- part.Size = Vector3.new(0.1,0.1,0.1)
- part.Transparency = 1
- part.CanCollide = false
- part.Name = "camera"
- part:BreakJoints()
- local weld = Instance.new("Weld", part)
- weld.Part0 = owner.Character.Head
- weld.Part1 = part
- weld.C0 = CFrame.new(0,0,-1)
- cananimate = true
- walkpressed = 0
- humanoid = owner.Character:findFirstChildOfClass("Humanoid")
- rootpart = owner.Character.HumanoidRootPart
- runservice = game:GetService("RunService")
- --
- canmovecamera = true
- wrunning = false
- wrunningl = false
- owner.Character.ChildAdded:connect(function(whatadded)
- if whatadded.Name == "slide" then
- canmovecamera = false
- for i = 1,60 do
- workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(math.sin(tick()*45)/(i/6)),0,0)
- runservice.RenderStepped:wait()
- end
- elseif whatadded.Name == "vwallrun" then
- canmovecamera = false
- for i = 1,20 do
- workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(2),0,0)
- runservice.RenderStepped:wait()
- end
- elseif whatadded.Name == "hwallrunright" then
- wrunning = true
- canmovecamera = false
- coroutine.wrap(function()
- while wrunning and runservice.RenderStepped:wait() do
- workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(0,0,math.rad(30)),0.2)
- end
- end)()
- elseif whatadded.Name == "hwallrunleft" then
- wrunningl = true
- canmovecamera = false
- coroutine.wrap(function()
- while wrunningl and runservice.RenderStepped:wait() do
- workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame:lerp(workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-30)),0.2)
- end
- end)()
- game.Workspace.mememasterYT65910.Humanoid.WalkSpeed = "30"
- elseif whatadded.Name == "FALLING" then
- local screengui = Instance.new("ScreenGui", owner:findFirstChildOfClass("PlayerGui"))
- screengui.ResetOnSpawn = true
- screengui.Name = "ohgodohfuck"
- local vel = Instance.new("BodyVelocity", rootpart)
- vel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- vel.Velocity = Vector3.new(0,-135,0)
- local frame = Instance.new("ImageLabel", screengui)
- frame.BackgroundTransparency = 1
- frame.ImageTransparency = 1
- frame.ImageColor3 = Color3.fromRGB(0,0,0)
- frame.Image = "http://www.roblox.com/asset/?id=22606915"
- frame.Size = UDim2.new(1,0,1,0)
- for i = 1,20 do
- frame.ImageTransparency = frame.ImageTransparency - 0.05
- runservice.Stepped:wait()
- end
- coroutine.wrap(function()
- while rootpart.Velocity.y < -10 do runservice.RenderStepped:wait() end
- screengui:destroy()
- vel:destroy()
- owner.Character:BreakJoints()
- end)()
- end
- end)
- owner.Character.ChildRemoved:connect(function(whatremoved)
- if whatremoved.Name == "slide" then
- canmovecamera = true
- elseif whatremoved.Name == "vwallrun" then
- for i = 1,20 do
- workspace.CurrentCamera.CFrame = workspace.CurrentCamera.CFrame * CFrame.fromEulerAnglesXYZ(math.rad(-2),0,0)
- runservice.RenderStepped:wait()
- end
- canmovecamera = true
- elseif whatremoved.Name == "hwallrunright" then
- canmovecamera = true
- wrunning = false
- elseif whatremoved.Name == "hwallrunleft" then
- canmovecamera = true
- wrunningl = false
- end
- end)
- --
- mouse.KeyDown:connect(function(key)
- key = key:lower()
- if key == "w" or key == "a" or key == "s" or key == "d" then
- walkpressed = walkpressed + 1
- end
- if key == "r" then
- parkietremote:FireServer(rootpart.CFrame, "triggerroll")
- end
- if key == "e" then
- parkietremote:FireServer(rootpart.CFrame, "slide")
- end
- end)
- mouse.KeyUp:connect(function(key)
- key = key:lower()
- if key == "w" or key == "a" or key == "s" or key == "d" then
- walkpressed = walkpressed - 1
- end
- if key == "r" then
- parkietremote:FireServer(rootpart.CFrame, "triggerroll")
- end
- end)
- --
- humanoid.Died:connect(function()
- local correction = Instance.new("ColorCorrectionEffect", workspace.CurrentCamera)
- local deathsound = Instance.new("Sound", owner:findFirstChildOfClass("PlayerGui"))
- deathsound.SoundId = "rbxassetid://1038809455"
- deathsound.Volume = 10
- deathsound:Play()
- game.Debris:AddItem(deathsound, deathsound.TimeLength)
- game.Debris:AddItem(correction, game:GetService("Players").RespawnTime)
- for i = 1,5 do
- correction.Brightness = correction.Brightness + 0.2
- runservice.RenderStepped:wait()
- end
- while runservice.RenderStepped:wait() do
- workspace.CurrentCamera.CFrame = CFrame.new(0,9999999,0)
- end
- end)
- --
- while game:GetService("RunService").RenderStepped:wait() do
- ----
- local vwallray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 2)
- local vwallhit, vwallpos, vwallsurface = workspace:FindPartOnRayWithIgnoreList(vwallray, {owner.Character})
- if vwallhit and humanoid.Jump and rootpart.Velocity.y > -30 then
- if not vwallhit.Parent:findFirstChildOfClass("Humanoid") then
- parkietremote:FireServer(rootpart.CFrame, "vwallrun", vwallhit, vwallpos, vwallsurface)
- end
- end
- ---
- local hwallray = Ray.new(rootpart.CFrame.p, (rootpart.CFrame.rightVector * 3.5) + (rootpart.CFrame.lookVector * -0.3))
- local hwallhit, hwallpos, surface = workspace:FindPartOnRayWithIgnoreList(hwallray, {owner.Character})
- if hwallhit and humanoid.Jump and rootpart.Velocity.y > -20 then
- if not hwallhit.Parent:findFirstChildOfClass("Humanoid") then
- parkietremote:FireServer(rootpart.CFrame, "hwallrunright", hwallhit, hwallpos, surface)
- end
- end
- --
- local hwallrayl = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * -3.5 + (rootpart.CFrame.lookVector * -0.3))
- local hwallhitl, hwallposl, surfacel = workspace:FindPartOnRayWithIgnoreList(hwallrayl, {owner.Character})
- if hwallhitl and humanoid.Jump and rootpart.Velocity.y > -20 then
- if not hwallhitl.Parent:findFirstChildOfClass("Humanoid") then
- parkietremote:FireServer(rootpart.CFrame, "hwallrunleft", hwallhitl, hwallposl, surfacel)
- end
- end
- ---
- local poleray = Ray.new(ownerhead.CFrame.p, ownerhead.CFrame.lookVector * 3.5)
- local polerayhit, poleraypos, poleraysurface = workspace:FindPartOnRayWithIgnoreList(poleray, {owner.Character})
- if polerayhit and rootpart.Velocity.y > -60 then
- if not polerayhit.Parent:findFirstChildOfClass("Humanoid") then
- parkietremote:FireServer(rootpart.CFrame, "polegrab", polerayhit, poleraypos, poleraysurface)
- end
- end
- --
- local poleray = Ray.new(ownerhead.CFrame.p, (ownerhead.CFrame.lookVector * 3.5) + (ownerhead.CFrame.upVector * -0.5))
- local polerayhit, poleraypos, poleraysurface = workspace:FindPartOnRayWithIgnoreList(poleray, {owner.Character})
- if polerayhit and rootpart.Velocity.y > -60 then
- if not polerayhit.Parent:findFirstChildOfClass("Humanoid") then
- parkietremote:FireServer(rootpart.CFrame, "polegrab", polerayhit, poleraypos, poleraysurface)
- end
- end
- --
- local poleray = Ray.new(ownerhead.CFrame.p, (ownerhead.CFrame.lookVector * 3.5) + (ownerhead.CFrame.upVector * 0.5))
- local polerayhit, poleraypos, poleraysurface = workspace:FindPartOnRayWithIgnoreList(poleray, {owner.Character})
- if polerayhit and rootpart.Velocity.y > -60 then
- if not polerayhit.Parent:findFirstChildOfClass("Humanoid") then
- parkietremote:FireServer(rootpart.CFrame, "polegrab", polerayhit, poleraypos, poleraysurface)
- end
- end
- ----
- if walkpressed > 0 and humanoid.WalkSpeed < 23 and not owner.Character:findFirstChild("ouchfell") then
- humanoid.WalkSpeed = humanoid.WalkSpeed + 1.2
- elseif walkpressed == 0 and humanoid.WalkSpeed > 0 and not owner.Character:findFirstChild("ouchfell") then
- humanoid.WalkSpeed = humanoid.WalkSpeed - 1.2
- end
- if (workspace.CurrentCamera.CFrame.p - part.Position).magnitude <= 1.7 then
- if canmovecamera and not owner.Character:findFirstChild("ouchfell") and not owner.Character:findFirstChild("rollin") and not owner.Character:findFirstChild("pole") then
- game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.CFrame = CFrame.new(game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position,Vector3.new(mouse.Hit.p.x,game:GetService("Players").LocalPlayer.Character.HumanoidRootPart.Position.y,mouse.Hit.p.z))
- end
- if owner.Character:findFirstChild("ouchfell") then
- workspace.CurrentCamera.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-0.4)
- end
- if owner.Character:findFirstChild("rollin") then
- workspace.CurrentCamera.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-0.2)
- end
- if owner.Character:findFirstChild("FALLING") then
- canmovecamera = false
- workspace.CurrentCamera.CFrame = owner.Character.Head.CFrame * CFrame.new(0,0,-0.4) * CFrame.fromEulerAnglesXYZ(math.rad(math.sin(tick()*45))*6,0,0)
- end
- workspace.CurrentCamera.FieldOfView = 120
- for i,v in pairs(owner.Character:GetChildren()) do
- if v.ClassName == "Part" or v.ClassName == "MeshPart" and v.Name ~= "Head" then
- v.LocalTransparencyModifier = 0
- end
- if v.ClassName == "Accessory" then
- v.Handle.Transparency = 1
- end
- end
- if owner.Character.Head:findFirstChildOfClass("Decal") then
- owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 1
- end
- owner.Character.Head.Transparency = 1
- workspace.CurrentCamera.CameraSubject = part
- else
- for i,v in pairs(owner.Character:GetChildren()) do
- if v.ClassName == "Accessory" then
- v.Handle.Transparency = 0
- end
- end
- workspace.CurrentCamera.FieldOfView = 70
- owner.Character.Head.Transparency = 0
- if owner.Character.Head:findFirstChildOfClass("Decal") then
- owner.Character.Head:findFirstChildOfClass("Decal").Transparency = 0
- end
- workspace.CurrentCamera.CameraSubject = owner.Character
- end
- end
- ]], character)
- local ownerhead = character:WaitForChild("Head")
- mouse = owner:GetMouse()
- anim = "idle"
- cananimate = true
- humanoid = character:findFirstChildOfClass("Humanoid")
- rootpart = character.HumanoidRootPart
- runservice = game:GetService("RunService")
- local rightarm = Instance.new("Weld", owner.Character.Torso)
- rightarm.Part0 = owner.Character.Torso
- rightarm.Part1 = owner.Character["Right Arm"]
- rightarm.C0 = CFrame.new(1.5,0,0)
- rightarm.Name = "RightArmWeld"
- local rightleg = Instance.new("Weld", owner.Character.Torso)
- rightleg.Part0 = owner.Character.Torso
- rightleg.Part1 = owner.Character["Right Leg"]
- rightleg.C0 = CFrame.new(0.5,-2,0)
- rightleg.Name = "RightLegWeld"
- local leftarm = Instance.new("Weld", owner.Character.Torso)
- leftarm.Part0 = owner.Character.Torso
- leftarm.Part1 = owner.Character["Left Arm"]
- leftarm.C0 = CFrame.new(-1.5,0,0)
- leftarm.Name = "LeftArmWeld"
- local leftleg = Instance.new("Weld", owner.Character.Torso)
- leftleg.Part0 = owner.Character.Torso
- leftleg.Part1 = owner.Character["Left Leg"]
- leftleg.C0 = CFrame.new(-0.5,-2,0)
- leftleg.Name = "LeftLegWeld"
- local head = Instance.new("Weld", owner.Character.Torso)
- head.Part0 = owner.Character.Torso
- head.Part1 = owner.Character.Head
- head.C0 = CFrame.new(0,1.5,0)
- head.Name = "HeadWeld"
- local humanoidrootpart = Instance.new("Weld", owner.Character.HumanoidRootPart)
- humanoidrootpart.Part0 = owner.Character.HumanoidRootPart
- humanoidrootpart.Part1 = owner.Character.Torso
- humanoidrootpart.Name = "HumanoidRootPartWeld"
- local music = Instance.new("Sound", owner.Character.Head)
- music.Looped = true
- local musicrandom = math.random(1,5)
- if musicrandom == 1 then
- music.SoundId = "rbxassetid://4502246491"
- music.Volume = 2
- elseif musicrandom == 2 then
- music.SoundId = "rbxassetid://469593664"
- music.Volume = 2
- elseif musicrandom == 3 then
- music.SoundId = "rbxassetid://477207390"
- music.Volume = 2
- elseif musicrandom == 4 then
- music.SoundId = "rbxassetid://147811295"
- music.Volume = 2
- elseif musicrandom == 5 then
- music.SoundId = "rbxassetid://4519453403"
- music.Volume = 1
- end
- music:Play()
- local runsound = Instance.new("Sound", owner.Character.Head)
- runsound.SoundId = "rbxassetid://3084278209"
- runsound.Looped = true
- runsound:Play()
- runsound.PlaybackSpeed = 1.4
- local bodyhitsound = Instance.new("Sound", owner.Character.Head)
- bodyhitsound.SoundId = "rbxassetid://261338552"
- bodyhitsound.Volume = 0.5
- local fallingsound = Instance.new("Sound", owner.Character.Head)
- fallingsound.SoundId = "rbxassetid://866649671"
- fallingsound.Volume = 0
- fallingsound.Looped = true
- fallingsound:Play()
- local parkietremote = Instance.new("RemoteEvent", character)
- parkietremote.Name = "parkietremote"
- cando = true
- roll = false
- fallingtodeath = false
- grabbedpole = false
- parkietremote.OnServerEvent:connect(function(plr, rootpos, what, rayehit, rayepos, rayesurface)
- if plr == owner and not fallingtodeath and cando then
- character.HumanoidRootPart.CanCollide = false
- if what == "slide" then
- cananimate = false
- cando = false
- local action = Instance.new("BoolValue", character)
- action.Name = "slide"
- local velo = Instance.new("BodyVelocity", rootpart)
- velo.MaxForce = Vector3.new(math.huge,0,math.huge)
- velo.Velocity = rootpart.CFrame.lookVector*22
- runsound.Volume = 0
- for i = 0,1 , 0.04 do
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.70441437, 0.561628342, 9.53674316e-07, 0.642787516, -0.766044259, 1.49011612e-08, 0.766044319, 0.642787576, 0, 1.17273338e-08, -1.27691155e-08, 0.99999994),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.54449558, -0.470175743, -0.242582321, 0.983905256, -0.168530971, 0.0593911819, 0.178687513, 0.926305115, -0.331706733, 0.000888578361, 0.336980522, 0.941511095),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.500000954, -1.64282608, -0.0428800583, 0.999999821, -1.0857935e-08, 1.23050938e-08, 0, 0.939692557, 0.342019677, 1.49011612e-08, -0.342019677, 0.939692557),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5, -2, 0, 0.999999821, 0, 1.49011612e-08, 0, 0.99999994, 0, 1.49011612e-08, 0, 0.99999994),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(-0.416755676, -2.3635385, 0, 0.98480767, 0, -0.173648164, -0.173648179, -4.37113883e-08, -0.98480773, -7.59040297e-09, 1, -4.30473115e-08),i)
- head.C0 = head.C0:lerp(CFrame.new(-9.53674316e-07, 1.15137196, -0.85847187, 0.999999821, -4.60215439e-08, -1.65799918e-07, 1.71363354e-07, 0.173648059, 0.98480767, 2.98023153e-08, -0.984807611, 0.173648059),i)
- runservice.Stepped:wait()
- end
- local funnysine = 0
- for i = 1,60 do
- local ray = Ray.new(character.Torso.Position, character.Torso.CFrame.upVector*-5.5)
- local hit, positionn = workspace:FindPartOnRayWithIgnoreList(ray, {character})
- if hit then
- break
- end
- velo.Velocity = velo.Velocity/1.01
- runservice.Stepped:wait()
- end
- velo:destroy()
- action:destroy()
- cananimate = true
- cando = true
- elseif what == "vwallrun" then
- local polereally = false
- if rayehit.Size.y <= 1 then
- if rayehit.Size.z > rayehit.Size.x and rayehit.Size.x <= 1 then
- --print("pole z > x BAD")
- polereally = true
- elseif rayehit.Size.x > rayehit.Size.z and rayehit.Size.z <= 1 then
- --print("pole x > z BAD")
- polereally = true
- end
- end
- if not polereally then
- cananimate = false
- cando = false
- humanoid.AutoRotate = false
- local action = Instance.new("BoolValue", character)
- action.Name = "vwallrun"
- character.HumanoidRootPart.CFrame = rootpos
- local goupvel = Instance.new("BodyVelocity", rootpart)
- goupvel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- goupvel.Velocity = Vector3.new(0,20,0)
- local gotin = false
- for i = 1,70 do
- local headray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.upVector * 3.5)
- local headrayhit, headraypos = workspace:FindPartOnRayWithIgnoreList(headray, {owner.Character})
- if headrayhit then
- gotin = false
- break
- end
- local headraywall = Ray.new(ownerhead.CFrame.p, ownerhead.CFrame.lookVector * 3)
- local headraywallhit, headraywallpos = workspace:FindPartOnRayWithIgnoreList(headraywall, {owner.Character})
- if not headraywallhit then
- gotin = true
- break
- end
- goupvel.Velocity = goupvel.Velocity/1.025
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(),0.3)
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(30),0,0) * CFrame.new(0,0.5,0),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi/2+math.sin(i/5),0,math.cos(i/5)/3) * CFrame.new(0,-0.5,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2-math.sin(i/5),0,-math.cos(i/5)/3) * CFrame.new(0,-0.5,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.cos(i/5)/2,0) * CFrame.Angles(-math.sin(i/5),0,0) * CFrame.new(0,-1,0),0.3)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1+math.cos(i/5)/2,0) * CFrame.Angles(math.sin(i/5),0,0) * CFrame.new(0,-1,0),0.3)
- runservice.Stepped:wait()
- end
- action:destroy()
- if gotin then
- rootpart.Anchored = true
- for i = 1,30 do
- rootpart.CFrame = rootpart.CFrame * CFrame.new(0,0.15,-math.sin(i/14)/9)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(math.rad(-20),0,0),0.3)
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(20),0,0) * CFrame.new(0,0.5,0),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.rad(60)+math.cos(i/7)*1.5,0,0) * CFrame.new(0,-0.5,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(60)+math.cos(i/7)*1.5,0,0) * CFrame.new(0,-0.5,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,-1,0),0.3)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-0.25+math.cos(i/7)/1.2,-0.5) * CFrame.Angles(0,0,0) * CFrame.new(0,-1,0),0.3)
- runservice.Stepped:wait()
- end
- end
- humanoid.AutoRotate = true
- rootpart.Anchored = false
- goupvel:destroy()
- cananimate = true
- cando = true
- end
- elseif what == "hwallrunright" and anim == "jumprun" or anim == "fallrun" and rayepos ~= nil then
- cananimate = false
- cando = false
- humanoid.AutoRotate = false
- local action = Instance.new("BoolValue", character)
- action.Name = "hwallrunright"
- rootpart.CFrame = CFrame.new(rayepos, rayepos + rayesurface) * CFrame.fromEulerAnglesXYZ(0,-math.pi/2,0)
- rootpart.CFrame = rootpart.CFrame * CFrame.new(-1.8,0,0)
- if rootpart:findFirstChild("wallrunvel") then
- rootpart:findFirstChild("wallrunvel"):destroy()
- end
- local goupvel = Instance.new("BodyVelocity", rootpart)
- goupvel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- goupvel.Velocity = rootpart.CFrame.lookVector * 20
- goupvel.Name = "wallrunvel"
- runsound.PlaybackSpeed = 1.7
- runsound.Volume = 1.5
- local jumped = false
- local shouldcontinue = true
- local candothat = true
- for i = 1,20 do
- local rootrightray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * 2.5)
- local wallrighthit, rootrightraypos = workspace:FindPartOnRayWithIgnoreList(rootrightray, {owner.Character})
- if not wallrighthit then
- shouldcontinue = false
- break
- end
- local rootfrontray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 4)
- local rootfrontrayhit, rootfrontraypos = workspace:FindPartOnRayWithIgnoreList(rootfrontray, {owner.Character})
- if rootfrontrayhit then
- shouldcontinue = false
- break
- end
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,0,math.rad(30)),0.3)
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(-math.sin(tick()*14)*1.3,0,math.rad(-15)) * CFrame.new(0,-0.5,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,math.pi/1.5) * CFrame.new(0,-0.5,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*14)/2,-math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*14)/2,math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
- runservice.Stepped:wait()
- end
- for i = 1,60 do
- if candothat then
- if not shouldcontinue then
- break
- end
- if humanoid.Jump then
- jumped = true
- break
- end
- local rootrightray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * 2.5)
- local wallrighthit, rootrightraypos = workspace:FindPartOnRayWithIgnoreList(rootrightray, {owner.Character})
- if not wallrighthit then
- break
- end
- local rootfrontray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 4)
- local rootfrontrayhit, rootfrontraypos = workspace:FindPartOnRayWithIgnoreList(rootfrontray, {owner.Character})
- if rootfrontrayhit then
- break
- end
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,0,math.rad(30)),0.3)
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(-math.sin(tick()*14)*1.3,0,math.rad(-15)) * CFrame.new(0,-0.5,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,math.pi/1.5) * CFrame.new(0,-0.5,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*14)/2,-math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*14)/2,math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
- runservice.Stepped:wait()
- end
- end
- action:destroy()
- candothat = false
- if jumped then
- goupvel.Velocity = goupvel.Velocity + (rootpart.CFrame.rightVector*-20) + Vector3.new(0,5,0)
- game.Debris:AddItem(goupvel, 0.25)
- for i = 0,0.6 ,0.03 do
- if not cananimate then
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.rad(10),math.rad(-5),0) * CFrame.new(0,0.5,0),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.fromEulerAnglesXYZ(-math.rad(40),0,math.rad(-2)) * CFrame.new(0,-1,0),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.fromEulerAnglesXYZ(math.rad(40),0,math.rad(2)) * CFrame.new(0,-1,0),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(math.rad(-10),0,math.rad(10)),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(math.pi/2+math.rad(20),0,0) * CFrame.new(0,-0.5,0),i)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(-math.pi/3,0,0) * CFrame.new(0,-0.5,0),i)
- runservice.Stepped:wait()
- end
- end
- else
- goupvel:destroy()
- end
- humanoid.AutoRotate = true
- cananimate = true
- cando = true
- elseif what == "hwallrunleft" and anim == "jumprun" or anim == "fallrun" and rayepos ~= nil then
- cananimate = false
- cando = false
- humanoid.AutoRotate = false
- local action = Instance.new("BoolValue", character)
- action.Name = "hwallrunleft"
- rootpart.CFrame = CFrame.new(rayepos, rayepos + rayesurface) * CFrame.fromEulerAnglesXYZ(0,math.pi/2,0)
- rootpart.CFrame = rootpart.CFrame * CFrame.new(1.8,0,0)
- if rootpart:findFirstChild("wallrunvel") then
- rootpart:findFirstChild("wallrunvel"):destroy()
- end
- local goupvel = Instance.new("BodyVelocity", rootpart)
- goupvel.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- goupvel.Velocity = rootpart.CFrame.lookVector * 20
- goupvel.Name = "wallrunvel"
- runsound.PlaybackSpeed = 1.7
- runsound.Volume = 1.5
- local jumped = false
- local shouldcontinue = true
- local candothat = true
- for i = 1,20 do
- local rootrightray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * -2.5)
- local wallrighthit, rootrightraypos = workspace:FindPartOnRayWithIgnoreList(rootrightray, {owner.Character})
- if not wallrighthit then
- shouldcontinue = false
- break
- end
- local rootfrontray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 4)
- local rootfrontrayhit, rootfrontraypos = workspace:FindPartOnRayWithIgnoreList(rootfrontray, {owner.Character})
- if rootfrontrayhit then
- shouldcontinue = false
- break
- end
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,0,math.rad(-30)),0.3)
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-math.pi/1.5) * CFrame.new(0,-0.5,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(-math.sin(tick()*14)*1.3,0,math.rad(15)) * CFrame.new(0,-0.5,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*14)/2,-math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*14)/2,math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
- runservice.Stepped:wait()
- end
- for i = 1,60 do
- if candothat then
- if not shouldcontinue then
- break
- end
- if humanoid.Jump then
- jumped = true
- break
- end
- local rootrightray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.rightVector * -2.5)
- local wallrighthit, rootrightraypos = workspace:FindPartOnRayWithIgnoreList(rootrightray, {owner.Character})
- if not wallrighthit then
- break
- end
- local rootfrontray = Ray.new(rootpart.CFrame.p, rootpart.CFrame.lookVector * 4)
- local rootfrontrayhit, rootfrontraypos = workspace:FindPartOnRayWithIgnoreList(rootfrontray, {owner.Character})
- if rootfrontrayhit then
- break
- end
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(0,0,math.rad(-30)),0.3)
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(0,0,0) * CFrame.new(0,0.5,0),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-math.pi/1.5) * CFrame.new(0,-0.5,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(-math.sin(tick()*14)*1.3,0,math.rad(15)) * CFrame.new(0,-0.5,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*14)/2,-math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*14)/2,math.cos(tick()*14)/2) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*14),0,0) * CFrame.new(0,-1,0),0.2)
- runservice.Stepped:wait()
- end
- end
- action:destroy()
- candothat = false
- if jumped then
- goupvel.Velocity = goupvel.Velocity + (rootpart.CFrame.rightVector*20) + Vector3.new(0,5,0)
- game.Debris:AddItem(goupvel, 0.25)
- for i = 0,0.6 ,0.03 do
- if not cananimate then
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.rad(10),math.rad(-5),0) * CFrame.new(0,0.5,0),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.fromEulerAnglesXYZ(-math.rad(40),0,math.rad(-2)) * CFrame.new(0,-1,0),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.fromEulerAnglesXYZ(math.rad(40),0,math.rad(2)) * CFrame.new(0,-1,0),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.fromEulerAnglesXYZ(math.rad(-10),0,math.rad(-10)),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,-0.5) * CFrame.fromEulerAnglesXYZ(-math.pi/3,0,0) * CFrame.new(0,-0.5,0),i)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi/2+math.rad(20),0,0) * CFrame.new(0,-0.5,0),i)
- runservice.Stepped:wait()
- end
- end
- else
- goupvel:destroy()
- end
- humanoid.AutoRotate = true
- cananimate = true
- cando = true
- elseif what == "triggerroll" then
- if roll then
- roll = false
- elseif not roll then
- roll = true
- end
- elseif what == "polegrab" then
- local polereally = false
- if rayehit.Size.y <= 1 then
- if rayehit.Size.z > rayehit.Size.x and rayehit.Size.x <= 1 then
- --print("pole z > x")
- polereally = true
- elseif rayehit.Size.x > rayehit.Size.z and rayehit.Size.z <= 1 then
- --print("pole x > z")
- polereally = true
- end
- end
- if polereally then
- cando = false
- cananimate = false
- humanoid.AutoRotate = false
- rootpart.Anchored = true
- grabbedpole = true
- local action = Instance.new("BoolValue", character)
- action.Name = "pole"
- local thesine = 0
- local speed = 3
- local sineadd = 0.2
- local multiply = 1.2
- coroutine.wrap(function()
- while grabbedpole and runservice.Stepped:wait() do
- thesine = thesine + sineadd
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(-math.sin(thesine/speed)*(multiply/1.5),0,0) * CFrame.new(0,0.5,0),0.3)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi,0,0) * CFrame.new(0,-0.8,0),0.3)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi,0,0) * CFrame.new(0,-0.8,0),0.3)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0) * CFrame.Angles(math.sin(thesine/speed)*multiply,0,0) * CFrame.new(0,-1,0),0.3)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.Angles(math.sin(thesine/speed)*multiply,0,0) * CFrame.new(0,-1,0),0.3)
- rootpart.CFrame = CFrame.new(rayepos, rayepos + rayesurface) * CFrame.fromEulerAnglesXYZ(-math.sin(thesine/speed)*multiply,math.pi,0) * CFrame.new(0,-2.5,0)
- if humanoid.Jump and math.sin(thesine/speed) > 0.2 then
- rootpart.Anchored = false
- grabbedpole = false
- action:destroy()
- local v = Instance.new("BodyVelocity", rootpart)
- v.MaxForce = Vector3.new(math.huge,math.huge,math.huge)
- v.Velocity = rootpart.CFrame.lookVector * 20
- game.Debris:AddItem(v, 0.5)
- humanoid.AutoRotate = true
- cananimate = true
- cando = true
- break
- end
- end
- end)()
- end
- end
- end
- end)
- coroutine.wrap(function()
- while runservice.Stepped:wait() do
- if rootpart.Velocity.x >= 2 or rootpart.Velocity.x <= -2 or rootpart.Velocity.z >= 2 or rootpart.Velocity.z <= -2 then
- if humanoid.FloorMaterial == Enum.Material.Air then
- if rootpart.Velocity.x >= 16 or rootpart.Velocity.x <= -16 or rootpart.Velocity.z >= 16 or rootpart.Velocity.z <= -16 then
- if rootpart.Velocity.y >= 3 then
- anim = "jumprun"
- --print("jumping (running)")
- elseif rootpart.Velocity.y <= -3 then
- anim = "fallrun"
- --("falling (running)")
- end
- else
- if rootpart.Velocity.y >= 3 then
- anim = "jump"
- --print("jumping (walking)")
- elseif rootpart.Velocity.y <= -3 then
- anim = "fall"
- --print("falling (walking)")
- end
- end
- else
- if rootpart.Velocity.x >= 16 or rootpart.Velocity.x <= -16 or rootpart.Velocity.z >= 16 or rootpart.Velocity.z <= -16 then
- anim = "run"
- --print("running")
- else
- anim = "walk"
- --print("walking")
- end
- end
- elseif rootpart.Velocity.x <= 2 or rootpart.Velocity.x >= -2 or rootpart.Velocity.z <= 2 or rootpart.Velocity.z >= -2 then
- if humanoid.FloorMaterial == Enum.Material.Air then
- if rootpart.Velocity.y >= 3 then
- anim = "jump"
- --print("jumping (standing)")
- elseif rootpart.Velocity.y < -3 then
- anim = "fall"
- --print("falling (standing)")
- end
- else
- anim = "idle"
- --print("standing")
- end
- end
- end
- end)()
- coroutine.wrap(function()
- while runservice.Stepped:wait() do
- if rootpart.Velocity.y < -90 then
- while rootpart.Velocity.y < 0 and rootpart.Velocity.y >= -135 and runservice.Stepped:wait() do
- --print("falling")
- end
- if rootpart.Velocity.y >= -135 then
- cananimate = false
- if not roll then
- print('hit ground')
- runsound.Volume = 0
- bodyhitsound.TimePosition = 1
- bodyhitsound:Play()
- local action = Instance.new("BoolValue", character)
- action.Name = "ouchfell"
- humanoid.WalkSpeed = 0
- humanoid.JumpPower = 0
- humanoid.Health = humanoid.Health - math.random(30,60)
- for i = 0,1 , 0.04 do
- humanoid.WalkSpeed = 0
- humanoid.JumpPower = 0
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.03661776, -0.287070274, -0.937994003, 1, 2.13205098e-09, 1.80749957e-08, 2.98023224e-08, 0.642787397, -0.766044438, 4.47034836e-08, 0.766044438, 0.642787457),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5, 0.00759601593, -0.0868253708, 1.00000012, 4.17280432e-09, 2.23762484e-08, 3.55271368e-15, 0.98480767, -0.173648164, 2.98023224e-08, 0.173648179, 0.98480773),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.188133717, -0.968682289, -0.200000763, 0.939692676, -0.342020154, 2.98023224e-08, 0.342020094, 0.939692557, -8.8817842e-16, 2.7206255e-08, -7.1326367e-09, 1),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5, -2, -9.53674316e-07, 1.00000012, 3.55271368e-15, 2.98023224e-08, 3.55271368e-15, 0.99999994, -8.8817842e-16, 2.98023224e-08, -8.8817842e-16, 1),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0.138917923, -1.81215382, -0.199999809, -0.17364794, 0, 0.984807789, -0.984807849, -4.37113883e-08, -0.173647955, 4.3047315e-08, -1, 7.59039409e-09),i)
- head.C0 = head.C0:lerp(CFrame.new(0, 1.3184042, -0.620952606, 1.00000012, -2.15236486e-08, 7.42341655e-09, 3.55271368e-15, 0.499999791, 0.866025388, 2.98023224e-08, -0.866025388, 0.499999791),i)
- runservice.Stepped:wait()
- end
- wait(0.7)
- for i = 0,0.35 , 0.005 do
- humanoid.WalkSpeed = 0
- humanoid.JumpPower = 0
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.43661785, 0.8717556, -1.1015135, 0.99999994, -1.49011354e-08, 2.58095625e-08, 2.98023171e-08, -0.342020303, -0.939692438, 1.49011914e-08, 0.939692736, -0.342020363),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5, 0.691013336, -1.08328879, 1, 1.29770106e-14, -3.44476568e-15, -1.36212808e-15, -0.173648149, -0.98480767, 2.84217094e-14, 0.984807968, -0.173648193),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5, -0.697739601, -0.911438107, 0.99999994, 6.67691635e-15, 1.17806545e-14, -1.36212851e-15, 0.939692438, -0.342020303, 2.84217094e-14, 0.342020422, 0.939692795),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.500000954, -1.51961517, -1.30000019, 1, 6.15348006e-15, 1.0658141e-14, -1.36212808e-15, 0.866025329, -0.49999997, 2.84217094e-14, 0.500000119, 0.866025627),i)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0.138917923, -0.812153816, -0.199999809, 1, 0, -1.93715096e-07, 1.93715096e-07, -4.37113883e-08, 1.00000012, -7.10542736e-15, -1, -4.37113883e-08),i)
- head.C0 = head.C0:lerp(CFrame.new(0, 1.56080723, -0.0747625828, 1, -3.66066168e-15, 2.96555518e-14, -1.36212808e-15, 0.98480767, 0.173648074, 2.84217094e-14, -0.173648104, 0.984807909),i)
- runservice.Stepped:wait()
- end
- humanoid.JumpPower = 50
- game.Debris:AddItem(action, 0.3)
- cananimate = true
- else
- local action = Instance.new("BoolValue", character)
- action.Name = "rollin"
- local rotva = 0
- coroutine.wrap(function()
- humanoidrootpart.C0 = CFrame.new(0,-1.5,0)
- for i = 1,35 do
- rootpart.CFrame = rootpart.CFrame * CFrame.new(0,0,-0.3)
- humanoidrootpart.C0 = humanoidrootpart.C0 * CFrame.fromEulerAnglesXYZ(math.rad(-8.5),0,0)
- runservice.Stepped:wait()
- end
- action:destroy()
- cananimate = true
- end)()
- for i = 0,1 , 0.04 do
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(0.5, 0.41317749, -1.40775204, 1.12057243e-08, 1, 4.07854905e-09, 0.173648134, 2.0707327e-09, -0.984807491, -0.984807551, 1.17437136e-08, -0.173648149),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5, 0.178607941, -0.38302207, 1, 0, 0, 0, 0.642787397, -0.766044199, 0, 0.766044259, 0.642787457),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5, -0.93637085, -0.903905869, 1, 0, 0, 0, 0.642787278, 0.766044319, 0, -0.766044378, 0.642787337),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5, -1.08567047, -0.913578272, 1, 0, 0, 0, 0.642787516, 0.76604408, 0, -0.76604414, 0.642787576),i)
- head.C0 = head.C0:lerp(CFrame.new(0, 1.30701828, -0.629077435, 1, 0, 0, 0, 0.438599855, 0.898682296, 0, -0.898682296, 0.438599855),i)
- runservice.Stepped:wait()
- end
- end
- elseif rootpart.Velocity.y < -135 then
- fallingtodeath = true
- local action = Instance.new("BoolValue", character)
- action.Name = "FALLING"
- local i = 0
- while runservice.Stepped:wait() do
- fallingsound.Volume = fallingsound.Volume + 0.06
- i = i + 1
- humanoidrootpart.C0 = humanoidrootpart.C0 * CFrame.fromEulerAnglesXYZ(math.rad(1.5),math.rad(0.5),math.rad(1))
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.Angles(math.rad(-10),0,0) * CFrame.new(0,0.5,0),0.2)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(math.pi/2+math.sin(i/5)*1.8,0,math.cos(i/5)/1.5) * CFrame.new(0,-0.7,0),0.2)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(math.pi/2+math.sin(i/4.5)*1.8,0,-math.cos(i/5)/1.5) * CFrame.new(0,-0.7,0),0.2)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.cos(i/5)/2,0) * CFrame.Angles(-math.sin(i/5),0,0) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1+math.cos(i/5)/2,0) * CFrame.Angles(math.sin(i/5),0,0) * CFrame.new(0,-1,0),0.2)
- --print('death falling')
- end
- end
- end
- end
- end)()
- while runservice.Stepped:wait() do
- if cananimate and not fallingtodeath then
- runsound.Volume = 0
- if anim == "idle" then
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(-5),0) * CFrame.new(0,0.5,0),0.2)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-2)) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2)) * CFrame.new(0,-1,0),0.2)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(5),0),0.2)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-5)-math.sin(tick())/20) * CFrame.new(0,-0.5,0),0.2)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(5)+math.sin(tick())/20) * CFrame.new(0,-0.5,0),0.2)
- elseif anim == "walk" then
- runsound.Volume = 0.4
- runsound.PlaybackSpeed = 1.1
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0.5,0),0.2)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*12)/4,-math.cos(tick()*12)/1.5) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*12)*1.5,0,0) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*12)/4,math.cos(tick()*12)/1.5) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*12)*1.5,0,0) * CFrame.new(0,-1,0),0.2)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.sin(tick()*24)/12,0) * CFrame.fromEulerAnglesXYZ(-math.rad(5),0,0),0.2)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.3+math.sin(tick()*12)/3,-0.2+math.sin(tick()*12)/2) * CFrame.fromEulerAnglesXYZ(math.rad(40)-math.sin(tick()*12)*2,0,-math.sin(tick()*12)/2.5) * CFrame.new(0,-0.5,0),0.2)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.3-math.sin(tick()*12)/3,-0.2-math.sin(tick()*12)/2) * CFrame.fromEulerAnglesXYZ(math.rad(40)+math.sin(tick()*12)*2,0,-math.sin(tick()*12)/2.5) * CFrame.new(0,-0.5,0),0.2)
- elseif anim == "run" then
- runsound.Volume = 1
- runsound.PlaybackSpeed = 1.4
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.rad(10),0,0) * CFrame.new(0,0.5,0),0.2)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1+math.cos(tick()*12)/2,-math.cos(tick()*12)/1.5) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*12)*1.4,0,0) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick()*12)/2,math.cos(tick()*12)/1.5) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*12)*1.4,0,0) * CFrame.new(0,-1,0),0.2)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,-0.2+math.sin(tick()*24)/10,0) * CFrame.fromEulerAnglesXYZ(0,math.rad(-rootpart.Orientation.y),0) * CFrame.fromEulerAnglesXYZ(humanoid.MoveDirection.z/5,0,-humanoid.MoveDirection.x/5) * CFrame.fromEulerAnglesXYZ(0,math.rad(rootpart.Orientation.y),0) * CFrame.fromEulerAnglesXYZ(-math.rad(10),0,0),0.2)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(10)-math.sin(tick()*12)*1.9,0,-math.sin(tick()*12)/2.5) * CFrame.new(0,-0.7,0),0.2)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.rad(10)+math.sin(tick()*12)*1.9,0,-math.sin(tick()*12)/2.5) * CFrame.new(0,-0.7,0),0.2)
- elseif anim == "jumprun" or anim == "fallrun" then
- if not roll then
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(math.rad(20),0,0) * CFrame.new(0,0.5,0),0.2)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1-math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(math.sin(tick()*2),0,math.rad(-2)) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1-math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(-math.sin(tick()*2),0,math.rad(2)) * CFrame.new(0,-1,0),0.2)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(math.rad(-20),0,0),0.2)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(-math.pi/3+math.sin(tick()*2)/5,0,math.cos(tick()*2)/5) * CFrame.new(0,-0.5,0),0.2)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi/2+math.rad(20)+math.sin(tick()*2)/5,0,-math.cos(tick()*2)/5) * CFrame.new(0,-0.5,0),0.2)
- else
- head.C0 = head.C0:lerp(CFrame.new(0, 1.38302183, -0.321395874, 1, 0, 0, 0, 0.766044259, 0.642787695, 0, -0.642787695, 0.766044259),0.2)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5, -2.00000048, 3.81469727e-06, 1, 0, 0, 0, 0.99999994, 0, 0, 1.49011612e-08, 1),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5, -2.00000048, 3.81469727e-06, 1, 0, 0, 0, 0.99999994, 0, 0, 1.49011612e-08, 1),0.2)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0, 0, 0, 1, 0, 0, 0, 0.984807789, 0.17364797, 0, -0.17364797, 0.984807789),0.2)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.18301296, -0.0232186317, -0.439029694, 0.866025329, -0.49999997, 0, 0.383022159, 0.663413882, -0.642787457, 0.321393758, 0.556670368, 0.766044438),0.2)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.18301296, -0.0232186317, -0.439029694, 0.866025388, 0.5, 0, -0.3830221, 0.663413823, -0.642787635, -0.321393877, 0.556670487, 0.766044259),0.2)
- end
- elseif anim == "jump" or anim == "fall" then
- head.C0 = head.C0:lerp(CFrame.new(0,1,0) * CFrame.fromEulerAnglesXYZ(0,0,0) * CFrame.new(0,0.5,0),0.2)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,0,-0.5) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(-2)) * CFrame.new(0,-1,0),0.2)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0) * CFrame.fromEulerAnglesXYZ(0,0,math.rad(2)) * CFrame.new(0,-1,0),0.2)
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.new(0,math.cos(tick())/15,0) * CFrame.fromEulerAnglesXYZ(0,0,0),0.2)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi-math.rad(30),0,0) * CFrame.new(0,-0.5,0),0.2)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.fromEulerAnglesXYZ(math.pi-math.rad(30),0,0) * CFrame.new(0,-0.5,0),0.2)
- end
- end
- end
Add Comment
Please, Sign In to add comment