> For the complete documentation index, see [llms.txt](https://swampys.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://swampys.gitbook.io/docs/resources/gta-6-hud/exports.md).

# Exports

Client-side exports for HUD visibility, minimap, weapon wheel, status bars, inventory and custom framework integration.

Call the resource from another client script with **exports\['gta6-hud']**.

{% hint style="info" %}
All exports on this page are client-side.
{% endhint %}

{% tabs %}
{% tab title="Visibility" %}

| Export                         | Returns | Description                                            |
| ------------------------------ | ------- | ------------------------------------------------------ |
| **SetHudVisible(visible)**     | boolean | Show or hide the complete NUI HUD.                     |
| **ShowHud()**                  | boolean | Show the HUD.                                          |
| **HideHud()**                  | boolean | Hide the HUD and close the weapon wheel if open.       |
| **IsHudVisible()**             | boolean | Return the current HUD state.                          |
| **SetMinimapVisible(visible)** | boolean | Show or hide the native minimap and custom frame.      |
| **ShowMinimap()**              | boolean | Restore the minimap when allowed by its configuration. |
| **HideMinimap()**              | boolean | Hide the minimap immediately.                          |
| **IsMinimapVisible()**         | boolean | Return the effective minimap state.                    |
| **SetVisible(visible)**        | boolean | Legacy alias of SetHudVisible.                         |

```lua
exports['gta6-hud']:HideHud()
exports['gta6-hud']:HideMinimap()

exports['gta6-hud']:ShowHud()
exports['gta6-hud']:ShowMinimap()
```

{% endtab %}

{% tab title="HUD" %}

| Export                          | Returns | Description                                              |
| ------------------------------- | ------- | -------------------------------------------------------- |
| **SetHudMode(mode)**            | boolean | Set **focus** or **essential** mode.                     |
| **GetHudMode()**                | string  | Return the active display mode.                          |
| **SetComponent(name, enabled)** | —       | Enable or disable a configured HUD component at runtime. |
| **GetFramework()**              | string  | Return the selected framework name.                      |
| **GetOxygen()**                 | number  | Return the current oxygen value from 0 to 100.           |

```lua
exports['gta6-hud']:SetHudMode('focus')
exports['gta6-hud']:SetComponent('crosshair', false)

local mode = exports['gta6-hud']:GetHudMode()
local framework = exports['gta6-hud']:GetFramework()
```

{% endtab %}

{% tab title="Weapon & Clothing" %}

| Export                  | Returns | Description                                                |
| ----------------------- | ------- | ---------------------------------------------------------- |
| **OpenWeaponWheel()**   | —       | Open the weapon wheel when the HUD and module are enabled. |
| **CloseWeaponWheel()**  | —       | Close the weapon wheel.                                    |
| **ToggleClothing(id)**  | boolean | Toggle a configured clothing or accessory slot.            |
| **GetClothingStates()** | table   | Return the on/off state of every configured slot.          |

```lua
exports['gta6-hud']:OpenWeaponWheel()
exports['gta6-hud']:ToggleClothing('mask')

local states = exports['gta6-hud']:GetClothingStates()
```

{% endtab %}

{% tab title="Status Bars" %}

| Export                               | Returns | Description                                |
| ------------------------------------ | ------- | ------------------------------------------ |
| **RegisterStatusBar(definition)**    | boolean | Register a runtime status bar.             |
| **RemoveStatusBar(id)**              | —       | Remove a runtime bar and its stored state. |
| **SetStatusBarValue(id, value)**     | boolean | Update a bar value from 0 to 100.          |
| **SetStatusBarVisible(id, visible)** | boolean | Override a bar visibility state.           |

```lua
exports['gta6-hud']:RegisterStatusBar({
    id = 'addiction',
    label = 'Addiction',
    icon = 'nui://my_inventory/web/images/addiction.png',
    color = '#D66BFF',
    order = 60,
    value = 0,
    hideWhenZero = true
})

exports['gta6-hud']:SetStatusBarValue('addiction', 45)
exports['gta6-hud']:SetStatusBarVisible('addiction', true)
exports['gta6-hud']:RemoveStatusBar('addiction')
```

Equivalent client events use the **gta6-hud:client:** prefix: **registerStatusBar**, **removeStatusBar**, **setStatusBarValue** and **setStatusBarVisible**.
{% endtab %}

{% tab title="Quick Slots" %}

| Export                          | Returns | Description                          |
| ------------------------------- | ------- | ------------------------------------ |
| **SetQuickSlots(slot1, slot2)** | —       | Replace both custom inventory slots. |
| **SetQuickSlot(slotId, data)**  | boolean | Update slot 1 or 2.                  |
| **ClearQuickSlots()**           | —       | Clear custom slot data.              |
| **UpdateQuickSlots()**          | —       | Force an inventory refresh.          |

```lua
exports['gta6-hud']:SetQuickSlot(1, {
    name = 'bandage',
    label = 'Bandage',
    count = 3,
    image = 'nui://ox_inventory/web/images/bandage.png',
    metadata = {}
})

exports['gta6-hud']:UpdateQuickSlots()
```

{% endtab %}

{% tab title="Custom Framework" %}
These exports are available when **Config.Framework = 'custom'**:

| Export                     | Returns | Description                            |
| -------------------------- | ------- | -------------------------------------- |
| **SetMoney(cash, bank)**   | —       | Update displayed cash and bank values. |
| **SetMentalHealth(value)** | —       | Update mental health from 0 to 100.    |

```lua
exports['gta6-hud']:SetMoney(2500, 12500)
exports['gta6-hud']:SetMentalHealth(80)
```

{% endtab %}

{% tab title="Advanced" %}

| Export                               | Returns | Description                          |
| ------------------------------------ | ------- | ------------------------------------ |
| **SendNUI(action, data)**            | —       | Send a custom action to the HUD NUI. |
| **SetNuiFocus(hasFocus, hasCursor)** | —       | Set NUI keyboard and cursor focus.   |

{% hint style="warning" %}
Advanced exports bypass the normal HUD flow. Use them only for custom integrations.
{% endhint %}
{% endtab %}
{% endtabs %}
