local l=game.Workspace.CurrentCamera local u=game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()local V=u:WaitForChild("\072\117\109\097\110\111\105\100")local p=0 local n=(u.Humanoid.WalkSpeed/2)*GENERAL_DAMPING local h=3.1415926 local T=h/2 local N=false local Y=false V.Strafing:Connect(function(l)Y=l end)V.Jumping:Connect(function()N=false end)V.Swimming:Connect(function()N=false end)V.Running:Connect(function(l)if l>.1 then N=true else N=false end end)local function d(l,u,V)return u+(l-u)*V end while true do(game:GetService("\082\117\110\083\101\114\118\105\099\101")).RenderStepped:Wait()fps=(l.CFrame.p-u.Head.Position).Magnitude if fps<.52 then p=1 else p=0 end if N==true and Y==false then T=T+V.WalkSpeed/92 else if T>0 and T<h/2 then T=d(T,h/2,.9)end if T>h/2 and T<h then T=d(T,h/2,.9)end if T>h and T<h*1.5 then T=d(T,h*1.5,.9)end if T>h*1.5 and T<h*2 then T=d(T,h*1.5,.9)end end if T>=h*2 then T=0 end l.CFrame=(l.CFrame*CFrame.new((math.cos(T)/n)*OFFSET_DAMPING,math.sin(T*2)/((n*2)*OFFSET_DAMPING),p))*CFrame.Angles(0,0,math.sin(T-h*1.5)/((n*15)*TILT_DAMPING))end
--// ------------------------------- //--
--// Don't edit anything below here! //--
--// ------------------------------- //--

local camera = game.Workspace.CurrentCamera
local character = game.Players.LocalPlayer.Character or game.Players.LocalPlayer.CharacterAdded:Wait()
local humanoid = character:WaitForChild("Humanoid")

local Z = 0
local damping = (character.Humanoid.WalkSpeed / 2) * GENERAL_DAMPING
local PI = 3.1415926
local tick = PI / 2
local running = false
local strafing = false

humanoid.Strafing:Connect(function(bool)
	strafing = bool
end)

humanoid.Jumping:Connect(function()
	running = false
end)

humanoid.Swimming:Connect(function()
	running = false
end)

humanoid.Running:Connect(function(speed)
	if speed > 0.1 then
		running = true
	else
		running = false
	end
end)

local function mix(par1, par2, factor)
	return par2 + (par1 - par2) * factor
end

while true do
	game:GetService("RunService").RenderStepped:Wait()

	fps = (camera.CFrame.p - character.Head.Position).Magnitude

	if fps < 0.52 then
		Z = 1
	else
		Z = 0
	end

	if running == true and strafing == false then
		tick = tick + humanoid.WalkSpeed / 92
	else
		if tick > 0 and tick < PI / 2 then
			tick = mix(tick, PI / 2, 0.9)
		end
		if tick > PI / 2 and tick < PI then
			tick = mix(tick, PI / 2, 0.9)
		end
		if tick > PI and tick < PI * 1.5 then
			tick = mix(tick, PI * 1.5, 0.9)
		end
		if tick > PI * 1.5 and tick < PI * 2 then
			tick = mix(tick, PI * 1.5, 0.9)
		end
	end

	if tick >= PI * 2 then
		tick = 0
	end

	camera.CFrame = camera.CFrame
		* CFrame.new(math.cos(tick) / damping * OFFSET_DAMPING, math.sin(tick * 2) / (damping * 2 * OFFSET_DAMPING), Z)
		* CFrame.Angles(0, 0, math.sin(tick - PI * 1.5) / (damping * 15 * TILT_DAMPING)) --Set camera CFrame
end
