How do I get the players color to change, but server sided?

  1. I need to get the players color to change on the server, Not the client

  2. I can’t get the local player in a script (it has to be a local script) and yes, I have tried events

  3. I have tried events and functions, I’m really not sure how to do this (also I couldn’t find any dev forum posts on this)

1 Like

you should rlly check youtube and see some tutorials and yeah trying to change the playes color server sided would need remote events

Could you please elaborate?

Also you could use PlayerAdded event providing a Player argument. And do stuff within that event.

I made a GUI that changes the color of a certain part on the player, but it only happens on the client, I need the part to also change colors on the server so all players can see it, But I don’t really know how to do that.

If you would like to change your color from the client, and execute this on the server, you will need to use Remote Events.

Here is the solution:

Server Code:

local Event = game:GetService("ReplicatedStorage").ChangeColor

Event.OnServerEvent:Connect(function(player, color)
    player.Character["Body Colors"].HeadColor = BrickColor.new(color)
end)

Client Code:

local Button = script.Parent -- Button location
local Color = script.Parent.Name -- Really red

Button.Activated:Connect(function()
    game.ReplicatedStorage.ChangeColor:FireServer(Color)
end)

You could also use Color3 values as the color, if you use HeadColor3.

I suggest you look into Body Colors, since this is what you need to change.

To elaborate on what @DylansAFK said, in simpler terms, you would create a remote event somewhere, then whenever the player presses the button, fire the remote event, on a server script, wait for the remote event to be fired, and then change the characters color.

Can you show us the script?
(char 30)