M MY Multiplayer: Wiki
Side
Kind

setConvar

Server

Sets a convar on the server, creating it if it does not exist. With synced, the value goes to every client, including those who join later, and their getConvar reads it.

Also exists on the client, with its own implementation: setConvar

bool setConvar(string name, string value [, bool synced = false])

Parameters

NameTypeDescription
namestringThe convar's name.
valuestringThe value.
syncedboolSync it to the clients. A setConvar without it stops syncing the convar.default false

Returns

true.

Example

setConvar("weather_cycle", "1", true)
NoteA secret convar, such as password or server_key, cannot be synced: the call raises an error. A synced convar's name and value hold at most 4000 bytes together.

See also