RE_UpdateSpine.OnServerEvent:Connect(function(Q,Y)if Q.Character then local G=Q.Character.Humanoid if not G then return end if G:GetState()==Enum.HumanoidStateType.Dead then return end local L=Q.Character.Head.Neck local H=Q.Character.UpperTorso.Waist local j=Q.Character.LeftUpperArm.LeftShoulder local i=Q.Character.RightUpperArm.RightShoulder local s=CFrame.fromEulerAnglesYXZ(Y*.5,0,0)local q=CFrame.fromEulerAnglesYXZ(Y*.5,0,0)local d=CFrame.fromEulerAnglesYXZ(Y*.25,0,0)local E=CFrame.fromEulerAnglesYXZ(Y*.25,0,0)L.C0=Neck_CFrame*s H.C0=Waist_CFrame*q j.C0=Left_Upper_Arm_CFrame*d i.C0=Right_Upper_Arm_CFrame*E end end)
-- Rotates the arms, waist, and neck to make the aiming for more realistic
RE_UpdateSpine.OnServerEvent:Connect(function(player, theta)
	if player.Character then
		local humanoid = player.Character.Humanoid
		if not humanoid then
			return
		end

		-- Don't rotate when the player is dead
		if humanoid:GetState() == Enum.HumanoidStateType.Dead then
			return
		end

		local neck = player.Character.Head.Neck
		local waist = player.Character.UpperTorso.Waist
		local leftArm = player.Character.LeftUpperArm.LeftShoulder
		local rightArm = player.Character.RightUpperArm.RightShoulder

		-- Create new CFrame rotation for the joints
		local neckCFrame = CFrame.fromEulerAnglesYXZ(theta * 0.5, 0, 0)
		local waistCFrame = CFrame.fromEulerAnglesYXZ(theta * 0.5, 0, 0)
		local leftArmCFrame = CFrame.fromEulerAnglesYXZ(theta * 0.25, 0, 0)
		local rightArmArmCFrame = CFrame.fromEulerAnglesYXZ(theta * 0.25, 0, 0)

		-- Apply rotations
		neck.C0 = Neck_CFrame * neckCFrame
		waist.C0 = Waist_CFrame * waistCFrame
		leftArm.C0 = Left_Upper_Arm_CFrame * leftArmCFrame
		rightArm.C0 = Right_Upper_Arm_CFrame * rightArmArmCFrame
	end
end)
