How can I update what a character looks like on the server

I am creating a player customization GUI, and right now everything works only on the local side, so players can change their skin color, and clothes but it only changes locally so none of the other players can even see anything. I could make it so that every time a player changes their skin or clothes it fires a remote event but I think this will cause too much lag if players are trying out a bunch of different looks for their character. Is there a way that once the player closes the menu the game could just update their character to the server or something?

I don’t think it would cause lag. This seems like a totally normal way to use a remote event. I’m pretty sure using a remote event would be the only way to do this anyway.

it should be OK to just send the events every time they change anything

but its also possible to do what you said by sending a table when they close the GUI something like this

-- localscript
local data = {}
data.skin = Color3.new(0.5, 0.5, 0.5)
data.hair = "Long"

remoteEvent:FireServer(data)

-- serverscript
remoteEvent.OnServerEvent:Connect(function(player, data)
    if data.skin ~= nil then
        print(data.skin)
    end
    if data.hair ~= nil then
        print(data.hair)
    end
end)
1 Like