RE_UpdateSpine.OnServerEvent:Connect(function(w,l)if w.Character then local R=w.Character.Humanoid if not R then return end if R:GetState()==Enum.HumanoidStateType.Dead then return end local O=w.Character.Head.Neck local q=w.Character.UpperTorso.Waist local e=w.Character.LeftUpperArm.LeftShoulder local C=w.Character.RightUpperArm.RightShoulder local E=CFrame.fromEulerAnglesYXZ(l*.5,0,0)local V=CFrame.fromEulerAnglesYXZ(l*.5,0,0)local a=CFrame.fromEulerAnglesYXZ(l*.25,0,0)local u=CFrame.fromEulerAnglesYXZ(l*.25,0,0)O.C0=Neck_CFrame*E q.C0=Waist_CFrame*V e.C0=Left_Upper_Arm_CFrame*a C.C0=Right_Upper_Arm_CFrame*u end end)

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)
