Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- --By Rufus14
- NLS([[
- --By Rufus14
- owner = game:GetService("Players").LocalPlayer
- owner.Character:WaitForChild("Head")
- mouse = owner:GetMouse()
- local remote = owner.Character:WaitForChild("lookremote")
- 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)
- cangoup = true
- rolling = false
- function sprinton(key)
- key = key:lower()
- if key:byte() == 48 then
- owner.Character:findFirstChildOfClass("Humanoid").WalkSpeed = 30
- end
- end
- function sprintoff(key)
- key = key:lower()
- if key:byte() == 48 then
- owner.Character:findFirstChildOfClass("Humanoid").WalkSpeed = 16
- end
- end
- mouse.KeyUp:connect(sprintoff)
- mouse.KeyDown:connect(sprinton)
- while game:GetService("RunService").RenderStepped:wait() do
- remote:FireServer(mouse.Hit.p, mouse.Origin.p, workspace.CurrentCamera.CFrame)
- if (workspace.CurrentCamera.CFrame.p - part.Position).magnitude <= 1.7 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))
- workspace.CurrentCamera.FieldOfView = 100
- 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
- ]], owner.Character)
- step = game:GetService("RunService").Stepped
- 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.5,0)
- leftarm.C1 = CFrame.new(0,0.5,0)
- leftarm.Name = "LeftArmWeld"
- 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.5,0)
- rightarm.C1 = CFrame.new(0,0.5,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.C1 = CFrame.new(0,1,0)
- rightleg.Name = "RightLegWeld"
- 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.C1 = CFrame.new(0,1,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.C1 = CFrame.new(0,-0.1,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"
- sine = 0
- change = 1
- anim = "stand"
- rootpart = owner.Character.HumanoidRootPart
- walksound = Instance.new("Sound", owner.Character.Head)
- walksound.SoundId = "rbxassetid://1244506786"
- walksound.Looped = true
- walksound:Play()
- walksound.Volume = 0
- walksound.MaxDistance = 20
- jumpsound = Instance.new("Sound", owner.Character.Head)
- jumpsound.SoundId = "rbxassetid://158149887"
- jumpsound.Volume = 0.3
- jumpsound.MaxDistance = 20
- fallsound = Instance.new("Sound", owner.Character.Head)
- fallsound.SoundId = "rbxassetid://866649671"
- fallsound.Looped = true
- fallsound:Play()
- fallsound.Volume = 0
- fallsound.MaxDistance = 20
- fallbigsound = Instance.new("Sound", owner.Character.Head)
- fallbigsound.SoundId = "rbxassetid://535681058"
- fallbigsound.Volume = 1
- fallbigsound.MaxDistance = 30
- humanoid = owner.Character:findFirstChildOfClass("Humanoid")
- cananimate = true
- alreadyjumped = false
- falling = false
- function checkrun()
- while step:wait() do
- if owner.Character.HumanoidRootPart.Velocity.x <= -17 or owner.Character.HumanoidRootPart.Velocity.x >= 17 or owner.Character.HumanoidRootPart.Velocity.z <= -17 or owner.Character.HumanoidRootPart.Velocity.z >= 17 and humanoid.FloorMaterial ~= Enum.Material.Air then
- anim = "run"
- walksound.PlaybackSpeed = 1.9
- walksound.Volume = 0.8
- elseif rootpart.Velocity.x >= -9 or rootpart.Velocity.x <= 9 or rootpart.Velocity.z >= -9 or rootpart.Velocity.z <= 9 and humanoid.FloorMaterial ~= Enum.Material.Air then
- if rootpart.Velocity.z ~= 0 and rootpart.Velocity.x ~= 0 and humanoid.FloorMaterial ~= Enum.Material.Air then
- anim = "walk"
- walksound.PlaybackSpeed = 1.2
- walksound.Volume = 0.4
- else
- anim = "stand"
- walksound.Volume = 0
- end
- end
- if humanoid.FloorMaterial == Enum.Material.Air then
- cananimate = false
- walksound.Volume = 0
- if rootpart.Velocity.y > 0 then
- if not alreadyjumped then
- alreadyjumped = true
- jumpsound.TimePosition = 0.05
- jumpsound:Play()
- end
- local function a()
- for i = 0,0.6 , 0.07 do
- if not cananimate then
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.Angles(0.3,0,0),i)
- head.C0 = head.C0:lerp(CFrame.Angles(0.1,0,0) * CFrame.new(0,1.4,0),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(-0.1,0,0),i)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(-0.1,0,0),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-1,0),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-1,0),i)
- step:wait()
- end
- end
- end
- spawn(a)
- elseif rootpart.Velocity.y < 0 then
- falling = true
- local function a()
- for i = 0,1 , 0.05 do
- if not cananimate then
- humanoidrootpart.C0 = humanoidrootpart.C0:lerp(CFrame.Angles(-0.3,0,0),i)
- head.C0 = head.C0:lerp(CFrame.fromEulerAnglesXYZ(-0.3,0,0) * CFrame.new(0,1.4,0),i)
- leftarm.C0 = leftarm.C0:lerp(CFrame.new(-1.5,0.5,0) * CFrame.Angles(0,0,-1),i)
- rightarm.C0 = rightarm.C0:lerp(CFrame.new(1.5,0.5,0) * CFrame.Angles(0,0,1),i)
- leftleg.C0 = leftleg.C0:lerp(CFrame.new(-0.5,-0.5,-0.5),i)
- rightleg.C0 = rightleg.C0:lerp(CFrame.new(0.5,-0.5,-0.5),i)
- step:wait()
- end
- end
- end
- local function b()
- fallsound.Volume = 0
- while step:wait() and falling do
- fallsound.Volume = fallsound.Volume + 0.025
- end
- falling = false
- fallsound.Volume = 0
- end
- spawn(a)
- spawn(b)
- end
- elseif humanoid.FloorMaterial ~= Enum.Material.Air then
- cananimate = true
- end
- end
- end
- spawn(checkrun)
- local remote = Instance.new("RemoteEvent", owner.Character)
- remote.Name = "lookremote"
- local headd = Instance.new("Weld", owner.Character.Torso)
- headd.Part0 = owner.Character.Torso
- headd.Part1 = owner.Character.Head
- headd.C0 = CFrame.new(0,1,0)
- headd.Name = "HeaddWeld"
- function look(plr, where, origin, cameracf)
- if plr == owner then
- local lookvector = owner.Character.Torso.CFrame:toObjectSpace(cameracf).lookVector.unit
- headd.C0 = CFrame.new(0,1,0) * CFrame.Angles(lookvector.y,0,0)
- headd.C0 = headd.C0 * CFrame.Angles(0,-lookvector.x,0)
- headd.C0 = headd.C0 * CFrame.new(0,0.5,0)
- end
- end
- remote.OnServerEvent:connect(look)
- while step:wait() do
- sine = sine + change
- if anim == "stand" and cananimate then
- alreadyjumped = false
- if falling then
- falling = false
- fallbigsound:Play()
- end
- fallsound.Volume = 0
- humanoidrootpart.C0 = CFrame.new(0,math.sin(sine/65)/20,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
- leftarm.C0 = CFrame.new(-1.5,math.sin(sine/65)/12 + 0.5,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(7))
- rightarm.C0 = CFrame.new(1.5,math.sin(sine/65)/12 + 0.5,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(-7))
- leftleg.C0 = CFrame.new(-0.5,-math.sin(sine/65)/20 - 1,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
- rightleg.C0 = CFrame.new(0.5,-math.sin(sine/65)/20 - 1,0) * CFrame.Angles(math.rad(0),math.rad(0),math.rad(0))
- head.C0 = CFrame.new(0,1.4,0) * CFrame.Angles(math.rad(5 * math.sin(sine/65))-0.1,math.rad(0),math.rad(0))
- elseif anim == "run" and cananimate then
- alreadyjumped = false
- if falling then
- falling = false
- fallbigsound:Play()
- end
- fallsound.Volume = 0.35
- humanoidrootpart.C0 = CFrame.new(0,1*math.cos(sine/2.5)/10,0) * CFrame.Angles(math.rad(4*math.cos(sine/4))+math.rad(-20),math.rad(0),math.rad(1*math.cos(sine/5)))
- leftarm.C0 = CFrame.new(-1.5,0.5,-math.cos(sine/5)/4) * CFrame.Angles(0.2 + math.rad(80 * math.cos(sine/5)),math.rad(0),math.rad(12*math.cos(sine/5)))
- rightarm.C0 = CFrame.new(1.5,0.5,math.cos(sine/5)/4) * CFrame.Angles(0.2 + -math.rad(80 * math.cos(sine/5)),math.rad(0),math.rad(12*math.cos(sine/5)))
- leftleg.C0 = CFrame.new(-0.5,3*math.sin(sine/2.5)/10-1,math.cos(sine/5)/4) * CFrame.Angles(-math.rad(80 * math.cos(sine/5)),math.rad(0),math.rad(0))
- rightleg.C0 = CFrame.new(0.5,3*math.sin(sine/2.5)/10-1,-math.cos(sine/5)/4) * CFrame.Angles(math.rad(80 * math.cos(sine/5)),math.rad(0),math.rad(0))
- head.C0 = CFrame.new(0,1.4,0) * CFrame.Angles(-math.rad(4*math.cos(sine/4))+math.rad(15),math.rad(0),math.rad(0))
- elseif anim == "walk" and cananimate then
- alreadyjumped = false
- if falling then
- falling = false
- fallbigsound:Play()
- end
- fallsound.Volume = 0
- humanoidrootpart.C0 = CFrame.new(0,math.sin(sine/4)/15,0) * CFrame.Angles(math.rad(2*math.cos(sine/8))+math.rad(-5),math.rad(0),math.rad(2*math.cos(sine/8)))
- leftarm.C0 = CFrame.new(-1.5,0.5,0) * CFrame.Angles(-math.rad(55 * math.cos(sine/8)),math.rad(0),math.rad(5*math.cos(sine/8)))
- rightarm.C0 = CFrame.new(1.5,0.5,0) * CFrame.Angles(math.rad(55 * math.cos(sine/8)),math.rad(0),math.rad(5*math.cos(sine/8)))
- leftleg.C0 = CFrame.new(-0.5,-1.5*math.sin(sine/8)/8 -1,0) * CFrame.Angles(math.rad(55 * math.cos(sine/8)),math.rad(0),math.rad(0))
- rightleg.C0 = CFrame.new(0.5,1.5*math.sin(sine/8)/8 -1,0) * CFrame.Angles(-math.rad(55 * math.cos(sine/8)),math.rad(0),math.rad(0))
- head.C0 = CFrame.new(0,1.4,0) * CFrame.Angles(-math.rad(math.cos(sine/8))+math.rad(2.5),math.rad(0),math.rad(0))
- end
- end
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement