Arm moving up and down laggy for other players


^^very laggy, even though my friend is in asia while im in the US many other games can smoothen it out

--local script
RunService.RenderStepped:Connect(function(dt)
	if equipped then
         local rightX, rightY, rightZ = char.Torso["Right Shoulder"].C0:ToEulerAnglesYXZ()
	     char.Torso["Right Shoulder"].C0 = (char.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))

          local leftX, leftY, leftZ = char.Torso["Left Shoulder"].C0:ToEulerAnglesYXZ()
	      char.Torso["Left Shoulder"].C0 = (char.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y))
	      UpdateShouldersEvent:FireServer({
		(char.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y)),
		(char.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))
	})
   end
end)
--server script
UpdateShouldersEvent.OnServerEvent:Connect(function(player, positionData)
	local torso = player.Character.Torso
	fix errors 
	if torso:FindFirstChild("Left Shoulder") and torso:FindFirstChild("Right Shoulder") then
		torso["Left Shoulder"].C0 = positionData[1]
		torso["Right Shoulder"].C0 = positionData[2]
	end
end)

how should i make this smoother and not as laggy as in the video?

1 Like