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
| Name | Type | Description |
|---|---|---|
| name | string | The convar's name. |
| value | string | The value. |
| synced | bool | Sync 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.