> ## Documentation Index
> Fetch the complete documentation index at: https://lua.wingless.one/llms.txt
> Use this file to discover all available pages before exploring further.

# Cvar

> Console variable access.

Console variable access.

## Functions

```lua theme={null}
local cv = cvar.find('cl_interp_ratio')
```

Returns a cvar object, or `nil` if not found.

## Cvar methods

| Method | Returns | Description |
| - | - | - |
| `cv:name()` | `string` | ConVar name |
| `cv:get_int()` | `number` | Integer value |
| `cv:get_float()` | `number` | Float value |
| `cv:get_bool()` | `bool` | Boolean value |
| `cv:set_int(v)` | | Set integer value |
| `cv:set_float(v)` | | Set float value |
| `cv:set_bool(v)` | | Set boolean value |
| `cv:restore()` | | Restore original value |

Modified cvars are automatically restored when the script unloads.

## Example

```lua theme={null}
local interp = cvar.find('cl_interp_ratio')
interp:set_int(2)

events.on('unload', function()
    interp:restore()
end)
```


This documentation is built and hosted on [Mintlify](https://mintlify.com), a developer documentation platform.