local Y=Character:WaitForChild("\072\117\109\097\110\111\105\100")local i=Character:WaitForChild("\072\117\109\097\110\111\105\100\082\111\111\116\080\097\114\116")local U=Character:WaitForChild("\084\111\114\115\111")local D=U:WaitForChild("\078\101\099\107")local I=i:WaitForChild("\082\111\111\116\074\111\105\110\116")local k=U:WaitForChild("\082\105\103\104\116 \072\105\112")local q=U:WaitForChild("\076\101\102\116 \072\105\112")local d=q.C0 local b=k.C0 local f=D.C0 local t=I.C0 D.MaxVelocity=.33333333333333 RunService.RenderStepped:Connect(function()local Y=Camera.CoordinateFrame if Character:FindFirstChild("\084\111\114\115\111")and Character:FindFirstChild("\072\101\097\100")then local Y=U.CFrame.lookVector local i=Head.CFrame.p if D and I then if Camera.CameraSubject:IsDescendantOf(Character)or Camera.CameraSubject:IsDescendantOf(Player)then local U=PlayerMouse.Hit.p local W=(Head.CFrame.p-U).magnitude local V=Head.CFrame.Y-U.Y local T=CFrame.Angles(-(math.atan(V/W)*.5),((i-U).Unit:Cross(Y)).Y*1,0)D.C0=(D.C0:lerp(T*f,.25)).Rotation+f.Position local M=-(math.atan(V/W)*.5)local P=((i-U).Unit:Cross(Y)).Y*.5 local G=CFrame.Angles(M,P,0)local A=G*t I.C0=(I.C0:lerp(A,.25)).Rotation+t.Position local R=I.C0*t:Inverse()local r=R:Inverse()k.C0=r*b q.C0=r*d end end end end)
--New R6 stuff
local Humanoid = Character:WaitForChild("Humanoid")
local HumanoidRootPart = Character:WaitForChild("HumanoidRootPart")

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

local Waist = HumanoidRootPart:WaitForChild("RootJoint")

local RHip = Torso:WaitForChild("Right Hip")
local LHip = Torso:WaitForChild("Left Hip")

local LHipOriginC0 = LHip.C0
local RHipOriginC0 = RHip.C0

local NeckOriginC0 = Neck.C0
local WaistOriginC0 = Waist.C0

Neck.MaxVelocity = 1 / 3

RunService.RenderStepped:Connect(function()
	local CameraCFrame = Camera.CoordinateFrame

	if Character:FindFirstChild("Torso") and Character:FindFirstChild("Head") then
		local TorsoLookVector = Torso.CFrame.lookVector
		local HeadPosition = Head.CFrame.p

		if Neck and Waist then
			if Camera.CameraSubject:IsDescendantOf(Character) or Camera.CameraSubject:IsDescendantOf(Player) then
				local Point = PlayerMouse.Hit.p

				local Distance = (Head.CFrame.p - Point).magnitude
				local Difference = Head.CFrame.Y - Point.Y

				local goalNeckCFrame = CFrame.Angles(
					-(math.atan(Difference / Distance) * 0.5),
					(((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 1,
					0
				)
				Neck.C0 = Neck.C0:lerp(goalNeckCFrame * NeckOriginC0, 0.5 / 2).Rotation + NeckOriginC0.Position

				local xAxisWaistRotation = -(math.atan(Difference / Distance) * 0.5)
				local yAxisWaistRotation = (((HeadPosition - Point).Unit):Cross(TorsoLookVector)).Y * 0.5
				local rotationWaistCFrame = CFrame.Angles(xAxisWaistRotation, yAxisWaistRotation, 0)
				local goalWaistCFrame = rotationWaistCFrame * WaistOriginC0
				Waist.C0 = Waist.C0:lerp(goalWaistCFrame, 0.5 / 2).Rotation + WaistOriginC0.Position

				local currentLegCounterCFrame = Waist.C0 * WaistOriginC0:Inverse()

				local legsCounterCFrame = currentLegCounterCFrame:Inverse()

				RHip.C0 = legsCounterCFrame * RHipOriginC0
				LHip.C0 = legsCounterCFrame * LHipOriginC0
			end
		end
	end
end)
