How do I make this script able to see on the server

I want to make it so that other players can see your arms and head moving

-- plr = game.Players.LocalPlayer;
repeat
	wait()
until plr.Character
char = plr.Character
m = plr:GetMouse()
local IsEquipped = false


local origRightS = char:WaitForChild("Torso"):WaitForChild("Right Shoulder").C0
local origLeftS = char:WaitForChild("Torso"):WaitForChild("Left Shoulder").C0
local origNeck = char:WaitForChild("Torso"):WaitForChild("Neck").C0
local camera = game.Workspace.CurrentCamera

local UIS = game:GetService("UserInputService")

local c = game.Workspace.CurrentCamera

game:GetService("RunService").RenderStepped:Connect(function(delta)




	if IsEquipped == true then

		if char.Torso:FindFirstChild("Right Shoulder") then
			char.Torso["Right Shoulder"].C0 = char.Torso["Right Shoulder"].C0:Lerp(CFrame.new(1, .65, 0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y), 1.55, 0, 0) , 0.3)
		end
		if char.Torso:FindFirstChild("Left Shoulder") then
			char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0:Lerp(CFrame.new(-1, .65, 0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y), -1.55, 0, 0) , 0.3)
		end
		if char.Torso:FindFirstChild("Neck") then
			char.Torso["Neck"].C0 = char.Torso["Neck"].C0:Lerp(CFrame.new(0, 1, 0) * CFrame.Angles(-math.asin((m.Origin.p - m.Hit.p).unit.y) + 1.55, 3.15, 0), 0.3)
		end

	else

		if char.Torso:FindFirstChild("Right Shoulder") then
			char.Torso["Right Shoulder"].C0 = char.Torso["Right Shoulder"].C0:lerp(origRightS, 0.02)
		end


		if char.Torso:FindFirstChild("Left Shoulder") then
			char.Torso["Left Shoulder"].C0 = char.Torso["Left Shoulder"].C0:lerp(origLeftS, 0.02)
		end



		if char.Torso:FindFirstChild("Neck") then
			char.Torso["Neck"].C0 = char.Torso["Neck"].C0:lerp(origNeck, 0.02)
		end


	end



end)


char.ChildAdded:Connect(function(instance)
	for i,v in pairs(char:GetChildren()) do
		if v:IsA("Tool") then
			if v:FindFirstChild("HoldArmsStill") then

			else
				IsEquipped = true

			end
		end
	end
end)

char.ChildRemoved:Connect(function(instance)
	if instance:IsA("Tool") then
		IsEquipped = false
	end
end)

I know you need events but i’m not good at coding so i want to know how i can use events to replicate it to the server.

– CLIENT

You could sent the values through a UnreliableRemoteEvent (yes, it is a real thing) to the Server.

– SERVER

On the Server, you need a ServerScript that sends those same values to all nearby (or just all) clients in the game through another UnreliableRemoteEvent.

– ALL CLIENTS

Each client has a LocalScript that listens to the UnreliableRemoteEvent.
The LocalScript changes your character’s body part positions based on the information received.

– ISSUE

UnreliableRemoteEvents are exactly what they say they are. So, if a player un-equips a tool then the message may not be received by all clients. For that, you would need to also send/listen to a RemoteEvent for the “UnEquipped” signal.

The benefit of using UnreliableRemoteEvents is that they will not hang up or eat up a lot of bandwidth.

Clear as mud!? :slightly_smiling_face:

2 Likes