coroutine.resume(coroutine.create(function()while RunSrv.RenderStepped:wait()and(Hum:GetState()).Value~=15 do local L=Cam.CoordinateFrame if(IsR6 and Body.Torso or Body.UpperTorso)~=nil and Body.Head~=nil then local a=Trso.CFrame.lookVector local h=Head.CFrame.p if(IsR6 and Trso.Neck or Head.Neck)~=nil then if Cam.CameraSubject:IsDescendantOf(Body)or Cam.CameraSubject:IsDescendantOf(Plr)then local u=nil local B=nil if not MseGuide then u=(Head.CFrame.p-L.p).magnitude B=Head.CFrame.Y-L.Y if not IsR6 then Neck.C0=OrgnC0*Ang(aSin(B/u)*Fctor,-((h-L.p).Unit:Cross(a)).Y,0)else Neck.C0=OrgnC0*Ang(-(aSin(B/u)*Fctor),0,-((h-L.p).Unit:Cross(a)).Y)end else local L,E=Wrks:FindPartOnRay(Ray.new(Head.CFrame.p,Mouse.Hit.lookVector),Wrks,false,true)u=(Head.CFrame.p-E).magnitude B=Head.CFrame.Y-E.Y if not IsR6 then Neck.C0=OrgnC0*Ang(-(aTan(B/u)*Fctor),((h-E).Unit:Cross(a)).Y*Fctor,0)else Neck.C0=OrgnC0*Ang(aTan(B/u)*Fctor,0,((h-E).Unit:Cross(a)).Y*Fctor)end end end end end end end))
--[ Activation ]:

coroutine.resume(coroutine.create(function()
	while RunSrv.RenderStepped:wait() and Hum:GetState().Value ~= 15 do --[ Adding wait() here is the same as adding wait() later. ]
		local CamCF = Cam.CoordinateFrame
		--local MsePos = Mouse.Origin.p	--[ Might do something with this in a future update... ]
		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 Trso["Neck"]) or Head["Neck"]) ~= nil 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 = OrgnC0
								* Ang((aSin(Diff / Dist) * Fctor), -(((HdPos - CamCF.p).Unit):Cross(TrsoLV)).Y, 0)
						else --[ R15s actually have the properly oriented Neck CFrame. ]
							Neck.C0 = OrgnC0
								* Ang(-(aSin(Diff / Dist) * Fctor), 0, -(((HdPos - CamCF.p).Unit):Cross(TrsoLV)).Y)
						end
					else
						local _, Point =
							Wrks:FindPartOnRay(Ray.new(Head.CFrame.p, Mouse.Hit.lookVector), Wrks, false, true)
						Dist = (Head.CFrame.p - Point).magnitude
						Diff = Head.CFrame.Y - Point.Y
						if not IsR6 then
							Neck.C0 = OrgnC0
								* Ang(-(aTan(Diff / Dist) * Fctor), (((HdPos - Point).Unit):Cross(TrsoLV)).Y * Fctor, 0)
						else
							Neck.C0 = OrgnC0
								* Ang((aTan(Diff / Dist) * Fctor), 0, (((HdPos - Point).Unit):Cross(TrsoLV)).Y * Fctor)
						end
					end
				end
			end
		end
	end
end))
