local E=game:GetService("\082\117\110\083\101\114\118\105\099\101")local Z=game:GetService("\080\108\097\121\101\114\115")local w=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local c=Z.LocalPlayer local n=script.Parent local X=n:FindFirstChildOfClass("\072\117\109\097\110\111\105\100")local e=workspace.Camera repeat wait()until X local Q=n:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local B=n:WaitForChild("\084\111\114\115\111")local f=Q:WaitForChild("\082\111\111\116\074\111\105\110\116")local function h(E,Z,w)return E+(Z-E)*w end local U=nil local V=nil local g=0 local b=0 local A=f.C0 E.RenderStepped:Connect(function()U=Q.Velocity*Vector3.new(.2,0,.2)if U.Magnitude>2 then V=U.Unit g=Q.CFrame.RightVector:Dot(V)b=Q.CFrame.LookVector:Dot(V)else g=0 b=0 end f.C0=f.C0:Lerp(A*CFrame.Angles(math.rad(b*8),math.rad(-g*7),0),.2)end)


local RunService = game:GetService("RunService")
local Players = game:GetService("Players")
local TS = game:GetService("TweenService")

local Player = Players.LocalPlayer
local Character = script.Parent

local Humanoid = Character:FindFirstChildOfClass("Humanoid")

local camera = workspace.Camera

repeat wait() until Humanoid

local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")
local Torso = Character:WaitForChild("Torso")

local RootJoint = HumanoidRootPart:WaitForChild("RootJoint")

local function Lerp(a, b, c)
	return a + (b - a) * c
end

local Force = nil
local Direction = nil
local Value1 = 0
local Value2 = 0

local RootJointC0 = RootJoint.C0


RunService.RenderStepped:Connect(function()
	Force = HumanoidRootPart.Velocity * Vector3.new(0.2, 0, 0.2)

	if Force.Magnitude > 2 then
		Direction = Force.Unit
		Value1 = HumanoidRootPart.CFrame.RightVector:Dot(Direction)
		Value2 = HumanoidRootPart.CFrame.LookVector:Dot(Direction)
	else
		Value1 = 0
		Value2 = 0
	end

	RootJoint.C0 = RootJoint.C0:Lerp(RootJointC0 * CFrame.Angles(math.rad(Value2 * 8), math.rad(-Value1 * 7), 0), 0.2)
end)
