I am making an FPS game and want to transfer client arm position to the server for every player to see. The effect makes the client jitter since the arms are updating for everyone, including me.
I want to be able to keep the client from getting these updates for smooth first person gameplay.
On client:
On server:
Client Localscript:
RunService:BindToRenderStep("ShiftLock", Enum.RenderPriority.First.Value, function()
--smooth movement based on camera
local Neck = TweenService:Create(neck, TweenInfo.new(0.18, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {C0 = CFrame.new(0,1,0) * CFrame.Angles(math.rad(90)+(x/2),math.rad(-180),math.rad(0))}):Play()
local RArm = TweenService:Create(rarm, TweenInfo.new(0.09, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {C0 = CFrame.new(1,0.5,0) * CFrame.Angles(math.rad(0),math.rad(90),math.rad(0)+(x/1.2))}):Play()
local LArm = TweenService:Create(larm, TweenInfo.new(0.09, Enum.EasingStyle.Linear, Enum.EasingDirection.InOut), {C0 = CFrame.new(-1,0.5,0) * CFrame.Angles(math.rad(0),math.rad(-90),math.rad(0)+(-x/1.2))}):Play()
if count == 0 then
Limbs:FireServer(neck.C0, rarm.C0, larm.C0) --fires positions to server
count = 10
else
count -= 1
end
end)
Server script:
Limbs.OnServerEvent:Connect(function(plr, neck, rarm, larm)
plr.Character:WaitForChild("Torso"):FindFirstChild("Neck").C0 = neck
plr.Character:WaitForChild("Torso"):FindFirstChild("Right Shoulder").C0 = rarm
plr.Character:WaitForChild("Torso"):FindFirstChild("Left Shoulder").C0 = larm
end)
Help is appreciated.
