Passing color properties of part to all clients using FireAllClients()

Is it possible to change the color when i have tool that shoot part and the part appears color red on mine and color blue to all clients without creating a new clone of the part to all clients ?

Yep it’s possible.

ServerScript - OriginalPlayer is the player that shoot the part

RemoteEvent:FireAllClient(OriginalPlayer, Part, Color3.new(...))

LocalScript - Change the part color for each players, it does not change your if you’re the OriginalPlayer

local Player = game:GetService("Players").LocalPlayer

RemoteEvent.OnClientEvent:Connect(function(OriginalPlayer, Part, Color)
    if not (OriginalPlayer == Player) and Part then
        Part.Color = Color
    end
end)

i had tried this code but seems the part don’t replicate to the other clients

You can either tell the server, where the color changed, and let the server tell the other clients (and yours) which parts to change color

or you can change the color of the parts on your client, and tell the server which parts and which colors

You’re shooting it in client side or server side?

yeah, im shooting from the client side then pass it to server then to all clents.

So that’s why it doesn’t work, an object created on the client cannot be seen by the server and other clients, everything made on a client only exist for said client, server and other clients (players) do not see it.

So you need to make the part shooting on server side OR make a different shooting for each player point of view (shoot on your side > FireServer > FireAllClient > receive event and if the player that shooted is not yourself, then do the shoot effect from their weapon)

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.