if TurnCharacterToMouse==true then MseGuide=true HeadHorFactor=0 BodyHorFactor=0 end;(game:GetService("\082\117\110\083\101\114\118\105\099\101")).RenderStepped:Connect(function()local L=Cam.CoordinateFrame if(IsR6 and Body.Torso or Body.UpperTorso)~=nil and Body.Head~=nil then local A=Trso.CFrame.lookVector local g=Head.CFrame.p if IsR6 and Neck or Neck and Waist then if Cam.CameraSubject:IsDescendantOf(Body)or Cam.CameraSubject:IsDescendantOf(Plr)then local E=nil local m=nil if not MseGuide then E=(Head.CFrame.p-L.p).magnitude m=Head.CFrame.Y-L.Y if not IsR6 then Neck.C0=Neck.C0:lerp(NeckOrgnC0*Ang(aSin(m/E)*HeadVertFactor,-((g-L.p).Unit:Cross(A)).Y*HeadHorFactor,0),UpdateSpeed/2)Waist.C0=Waist.C0:lerp(WaistOrgnC0*Ang(aSin(m/E)*BodyVertFactor,-((g-L.p).Unit:Cross(A)).Y*BodyHorFactor,0),UpdateSpeed/2)else Neck.C0=Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(m/E)*HeadVertFactor),0,-((g-L.p).Unit:Cross(A)).Y*HeadHorFactor),UpdateSpeed/2)end else local L=Mouse.Hit.p E=(Head.CFrame.p-L).magnitude m=Head.CFrame.Y-L.Y if not IsR6 then Neck.C0=Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(m/E)*HeadVertFactor),((g-L).Unit:Cross(A)).Y*HeadHorFactor,0),UpdateSpeed/2)Waist.C0=Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(m/E)*BodyVertFactor),((g-L).Unit:Cross(A)).Y*BodyHorFactor,0),UpdateSpeed/2)else Neck.C0=Neck.C0:lerp(NeckOrgnC0*Ang(aTan(m/E)*HeadVertFactor,0,((g-L).Unit:Cross(A)).Y*HeadHorFactor),UpdateSpeed/2)end end end end end if TurnCharacterToMouse==true then Hum.AutoRotate=false Core.CFrame=Core.CFrame:lerp(CFrame.new(Core.Position,Vector3.new(Mouse.Hit.p.x,Core.Position.Y,Mouse.Hit.p.z)),UpdateSpeed/2)else Hum.AutoRotate=true end end)game.ReplicatedStorage.Look.OnClientEvent:Connect(function(L,A,g)local E=L.Character:FindFirstChild("\078\101\099\107",true)local m=L.Character:FindFirstChild("\087\097\105\115\116",true)if E and m then((game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")):Create(E,TweenInfo.new(.5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0),{C0=A})):Play();((game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")):Create(m,TweenInfo.new(.5,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false,0),{C0=g})):Play()end end)while wait(.0001)do game.ReplicatedStorage.Look:FireServer(Neck.C0,Waist.C0)end
-- Activation]:
if TurnCharacterToMouse == true then
	MseGuide = true
	HeadHorFactor = 0
	BodyHorFactor = 0
end

game:GetService("RunService").RenderStepped:Connect(function()
	local CamCF = Cam.CoordinateFrame
	if ((IsR6 and Body["Torso"]) or Body["UpperTorso"]) ~= nil and Body["Head"] ~= nil then --[Check for the Torso and Head...]
		local TrsoLV = Trso.CFrame.lookVector
		local HdPos = Head.CFrame.p
		if IsR6 and Neck or Neck and Waist then --[Make sure the Neck still exists.]
			if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
				local Dist = nil
				local Diff = nil
				if not MseGuide then --[If not tracking the Mouse then get the Camera.]
					Dist = (Head.CFrame.p - CamCF.p).magnitude
					Diff = Head.CFrame.Y - CamCF.Y
					if not IsR6 then --[R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y.]
						Neck.C0 = Neck.C0:lerp(
							NeckOrgnC0
								* Ang(
									(aSin(Diff / Dist) * HeadVertFactor),
									-(((HdPos - CamCF.p).Unit):Cross(TrsoLV)).Y * HeadHorFactor,
									0
								),
							UpdateSpeed / 2
						)
						Waist.C0 = Waist.C0:lerp(
							WaistOrgnC0
								* Ang(
									(aSin(Diff / Dist) * BodyVertFactor),
									-(((HdPos - CamCF.p).Unit):Cross(TrsoLV)).Y * BodyHorFactor,
									0
								),
							UpdateSpeed / 2
						)
					else --[R15s actually have the properly oriented Neck CFrame.]
						Neck.C0 = Neck.C0:lerp(
							NeckOrgnC0
								* Ang(
									-(aSin(Diff / Dist) * HeadVertFactor),
									0,
									-(((HdPos - CamCF.p).Unit):Cross(TrsoLV)).Y * HeadHorFactor
								),
							UpdateSpeed / 2
						)
					end
				else
					local Point = Mouse.Hit.p
					Dist = (Head.CFrame.p - Point).magnitude
					Diff = Head.CFrame.Y - Point.Y
					if not IsR6 then
						Neck.C0 = Neck.C0:lerp(
							NeckOrgnC0
								* Ang(
									-(aTan(Diff / Dist) * HeadVertFactor),
									(((HdPos - Point).Unit):Cross(TrsoLV)).Y * HeadHorFactor,
									0
								),
							UpdateSpeed / 2
						)
						Waist.C0 = Waist.C0:lerp(
							WaistOrgnC0
								* Ang(
									-(aTan(Diff / Dist) * BodyVertFactor),
									(((HdPos - Point).Unit):Cross(TrsoLV)).Y * BodyHorFactor,
									0
								),
							UpdateSpeed / 2
						)
					else
						Neck.C0 = Neck.C0:lerp(
							NeckOrgnC0
								* Ang(
									(aTan(Diff / Dist) * HeadVertFactor),
									0,
									(((HdPos - Point).Unit):Cross(TrsoLV)).Y * HeadHorFactor
								),
							UpdateSpeed / 2
						)
					end
				end
			end
		end
	end
	if TurnCharacterToMouse == true then
		Hum.AutoRotate = false
		Core.CFrame = Core.CFrame:lerp(
			CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)),
			UpdateSpeed / 2
		)
	else
		Hum.AutoRotate = true
	end
end)

game.ReplicatedStorage.Look.OnClientEvent:Connect(function(otherPlayer, neckCFrame, WaistCFrame)
	local Neck = otherPlayer.Character:FindFirstChild("Neck", true)
	local Waist = otherPlayer.Character:FindFirstChild("Waist", true)

	if Neck and Waist then
		game:GetService("TweenService")
			:Create(
				Neck,
				TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
				{ C0 = neckCFrame }
			)
			:Play()
		game:GetService("TweenService")
			:Create(
				Waist,
				TweenInfo.new(0.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0),
				{ C0 = WaistCFrame }
			)
			:Play()
	end
end)

while wait(0.0001) do
	game.ReplicatedStorage.Look:FireServer(Neck.C0, Waist.C0)
end
