set_synced_var

Sets the persistent global variable of that player slot. This value persists before and after matches, as well as being saved in replays.

ArgumentTypeDescription
player:realID of the player to get the synced variable of
value:intThe value to set the variable to

Example, called from css_update.gml:

// This character only sets their synced var to "true" when selecting a specific palette
if (get_player_color( player ) == 12) {
(set_synced_var( player, true)
} else {
(set_synced_var( player, false)
}