> 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/frameworks-and-inventory.md).

# Frameworks & Inventory

Connect GTA 6 HUD to ESX, QBCore, Qbox, standalone or custom frameworks and inventory providers.

{% stepper %}
{% step %}

#### Framework bridge

Set **Config.Framework** to one of the following values:

| Value          | Requirement                        | Currency source                           |
| -------------- | ---------------------------------- | ----------------------------------------- |
| **standalone** | None                               | Cash and bank default to 0                |
| **esx**        | es\_extended                       | ESX money and bank accounts               |
| **qbcore**     | qb-core                            | QBCore player money                       |
| **qbox**       | qbx\_core or qb-core compatibility | Qbox player money                         |
| **custom**     | Your own bridge                    | Values supplied through exports or events |

Start the selected framework before **gta6-hud**.
{% endstep %}

{% step %}

#### Custom framework

Set:

```lua
Config.Framework = 'custom'
```

Then edit **bridge/custom.lua**. The file remains editable with Asset Escrow.

Update currency and mental health from a client script:

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

The same values can be sent from the server:

```lua
TriggerClientEvent('gta6-hud:client:setMoney', playerId, 2500, 12500)
TriggerClientEvent('gta6-hud:client:setMentalHealth', playerId, 80)
```

{% endstep %}

{% step %}

#### Inventory provider

Choose how the first two inventory slots are read:

```lua
Config.Inventory = {
    provider = 'auto',
    customUseEvent = 'gta6-hud:server:useQuickSlot',
    customUseEventType = 'server',
}
```

| Provider          | Behavior                                       |
| ----------------- | ---------------------------------------------- |
| **auto**          | Detects ox\_inventory first, then qb-inventory |
| **ox\_inventory** | Reads and uses ox\_inventory slots 1 and 2     |
| **qb\_inventory** | Reads and uses qb-inventory slots 1 and 2      |
| **custom**        | Uses data supplied through the HUD API         |
| **none**          | Disables inventory data                        |

The inventory resource must start before **gta6-hud**.
{% endstep %}

{% step %}

#### Custom quick slots

A custom provider can send both slots from a client script:

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

Supported item fields include **name**, **label**, **count**, **image**, **icon** and **metadata**.
{% endstep %}

{% step %}

#### Handle custom item use

With the default custom server event, listen for validated quick-slot use:

```lua
AddEventHandler('gta6-hud:server:onUseQuickSlot', function(playerId, slotId, itemName, metadata)
    -- Validate the item and run your inventory logic here.
end)
```

{% hint style="warning" %}
Always validate inventory ownership and item quantity on the server before using or removing an item.
{% endhint %}
{% endstep %}
{% endstepper %}
