# setConvar (Client)

> Sets a convar on this client only. It is never sent to the server. With `persist`, the value is kept for this server and comes back in the next session.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Convars
- **URL**: https://wiki.mymp.gg/en/setConvar-client
- **Counterpart**: Also exists on the server, with its own implementation: [setConvar (Server)](https://wiki.mymp.gg/en/setConvar-server.md)

## Syntax

```lua
bool setConvar(string name, string value [, bool persist = false])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `name` | `string` | The convar's name. |
| `value` | `string` | The value. |
| `persist` | `bool` | Keep the value for the next sessions on this server. *(default: `false`)* |

## Returns

`true` if it was set, `false` while there is no session with a server. Raises an error if the server syncs that convar.

## Example

```lua
setConvar("hud_scale", "1.2", true)
```

### Note

What was kept with `persist` is lost when the server changes its `content.key`.

## See also

- [setConvar (Server)](https://wiki.mymp.gg/en/setConvar-server.md): 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.
- [getConvar (Shared)](https://wiki.mymp.gg/en/getConvar.md): Reads a convar as text. On a client, a convar the server syncs comes before the client's own.
