> For the complete documentation index, see [llms.txt](https://lt-studios.gitbook.io/lt-studios/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://lt-studios.gitbook.io/lt-studios/player-controls-guide/api-for-developers/client-side-exports/toggle.md).

# Toggle

This function can be useful for times where the whole UI needs to be turned off/on. For example, it is used in the actual code of the script to determine whether we need to show the UI or not when the GTAV Pause Menu is active. You can use it for your HUD Systems, UI Systems etc...

### Parameters

* `force` *(boolean)* – Optional, if not set will just toggle on/off. If defined will set to the value. (true/false)

### Usage Example

```lua
exports['lt-controls']:Toggle() -- On/Off
exports['lt-controls']:Toggle(true) -- Force On
exports['lt-controls']:Toggle(false) -- Force Off
```
