RemoteEvent that changes the color of a decal is not working

I’m making a game that has character customization, and you will select the color of the pupils in RGB. I did a RemoteEvent but it is not working, what is wrong?

image

I’ve rewritten the code several times based on other scripts but it didn’t work

game.ReplicatedStorage.RemoteEvent.OnServerEvent:Connect(function(player, liger,r,g,b)

liger.Color3 = Color3.fromRGB(r,g,b)

end)

Any errors in the output that your aware of?

Also you shouldnt pass the RGB value through the remote because players can fire it and change their pupils

edit : @45Fox54 How about you store the different eye colors on the server in a table like so

local pupilColors  = {
     
      Color3.fromRGB(255,0,0)
      Color3.fromRGB(0,255,0)
      Color3.fromRGB(0,0,255)

}

game.ReplicatedStoarge.RemoteEvent.OnServerEvent:Connect(function(player,liger,color)
    for _, colors in ipairs(pupilColors) do
        if color == colors then
            -- Do stuff
        end
    end
end
1 Like

I entered the game and gave fireserver, looked at the output and there was not

Alright try my code and tell me if anything works

18:28:35.857 - Players.45Fox54.PlayerGui.ScreenGui.TextButton.LocalScript:6: Expected ‘}’ (to close ‘{’ at line 3), got ‘Color3’

image

image