RemoteEvent not working on the server

Hi, i have a button that when the player presses it, it changes the material of meshparts in their character with the tag bodypart, i’m using a local script, a remote event and a server script however it only works on the client, so the other players cannot see it, here is the local script:

local button = script.Parent
local ReplicatedStorage = game:GetService("ReplicatedStorage")

local changeEvent = ReplicatedStorage:WaitForChild("ChangeBodyPartsEvent")

button.MouseButton1Click:Connect(function()
	changeEvent:FireServer()
end)

and here is the server script:

local ReplicatedStorage = game:GetService("ReplicatedStorage")
local CollectionService = game:GetService("CollectionService")

local changeEvent = ReplicatedStorage:WaitForChild("ChangeBodyPartsEvent")

changeEvent.OnServerEvent:Connect(function(player)
	local character = player.Character
	if character then
		local taggedParts = CollectionService:GetTagged("bodypart")
		for _, part in ipairs(taggedParts) do
			if part:IsDescendantOf(character) and part:IsA("MeshPart") then
				part.Material = Enum.Material.SmoothPlastic
				part.Transparency = 0
				part.Reflectance = 0.25
			end
		end
	end
end)

The local script is inserted in a button, the remote event is in replicated storage, the server script is in server script service, i am using a cusom character.
I have no idea what the issue is and i’m a little confused, it works only for the client.

Maybe the player hasn’t loaded yet. Try: local character = player and player.Character -- is the same as: if player then player.Character else nil

Have you tagged the bodyparts First

But the server sees the players character way before its replicated to the client And if you dont need to use CollectionService why not use GetDescendants() for the players character

Is the LocalScript inside of a part, or anything workspace related? If so, LocalScripts cannot run there and will just never execute. They must be put in something like StarterPlayer, StarterGui, or StarterPack, to execute successfully.

if you are tagging the body parts on the client, then it will not work