> For the complete documentation index, see [llms.txt](https://organized-chaos.gitbook.io/organized-chaos-docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://organized-chaos.gitbook.io/organized-chaos-docs/hoverboards/items.md).

# Items

Each board as an inventory item for ESX, QBCore, Qbox or ox\_inventory: set down in front of the player, picked up again with ox\_target.

With ESX, QBCore, Qbox or ox\_inventory each board can be an item. Used from the inventory, the player bends down and sets the board down in front of them, ready to be stepped on.

Every board has an item of the same name as its spawn name: `hoverboard`, `hoverboard_manta` ... `hoverboard_retro`. The script registers them as usable with whichever framework runs (`Config.Item.Framework`, `'auto'` by default: Qbox, then QBCore, then ESX, else ox\_inventory on its own). The items themselves have to be in the inventory's item list.

## Adding the items

{% tabs %}
{% tab title="ESX" %}
Run `install/esx_items.sql` on your database. It adds an `items` row for each board (weight 4).
{% endtab %}

{% tab title="QBCore" %}
Add one line per board to `qb-core/shared/items.lua`, for example:

```lua
hoverboard = { name = 'hoverboard', label = 'Hoverboard', weight = 4000, type = 'item', image = 'hoverboard.png',
               unique = true, useable = true, shouldClose = true, description = 'Set it down and fly' },
hoverboard_manta = { name = 'hoverboard_manta', label = 'Hoverboard Manta', weight = 4000, type = 'item',
               image = 'hoverboard_manta.png', unique = true, useable = true, shouldClose = true,
               description = 'Set it down and fly' },
```

{% endtab %}

{% tab title="ox\_inventory / Qbox" %}
Add one line per board to `ox_inventory/data/items.lua`:

```lua
['hoverboard'] = { label = 'Hoverboard', weight = 4000, stack = false, close = true,
                   server = { export = 'hoverboard.useItem' } },
['hoverboard_manta'] = { label = 'Hoverboard Manta', weight = 4000, stack = false, close = true,
                   server = { export = 'hoverboard.useItem' } },
```

On Qbox, ESX or QBCore the `server` line can be left out: the framework hands the use on to the item the script registered. With ox\_inventory on its own it is needed.
{% endtab %}

{% tab title="Another inventory" %}
Set `Config.Item.Framework = false` and have your inventory call this on the server when the item is used:

```lua
exports.hoverboard:putDownBoard(source, 'hoverboard_manta')
```

{% endtab %}
{% endtabs %}

`Config.Item.Items` names the board each item takes out. Leave out the boards you do not want as items.

## The board in the world is the item

With `Config.Item.Remove = true` (the default), setting the board down takes the item out of the inventory: the board in the world is the item now, and **picking it up** puts it back. The item is only taken once the board is really out; if it has left the inventory meanwhile, no board is made.

With ox\_target every board that came out of an inventory has a **Pick up Hoverboard** option (`Config.Item.PickUp`): the player bends down for it, and it goes into their inventory, unless the inventory is full. Nobody may be standing on it. `OwnOnly = true` lets only the player who set it down pick it up. Boards from `/hoverboard`, `/car` or a garage are nobody's item and cannot be picked up.

`Target = false` leaves the option to a target script of your own, which calls `exports.hoverboard:pickUp(board)`, and `exports.hoverboard:canPickUp(board)` to decide whether to show it. See [Exports](/organized-chaos-docs/hoverboards/exports.md).

## Keeping the item instead

With `Remove = false` the item stays in the inventory, a player can set down as many boards as they like, and picking one up only puts it away. Then:

| Setting         | What it does                                                                            |
| --------------- | --------------------------------------------------------------------------------------- |
| `OnePerPlayer`  | Setting down another board puts away the player's last one, unless someone stands on it |
| `RemoveOnLeave` | A player's board goes when they leave the server, unless someone stands on it           |

## Setting it down

`Config.Item.PutDown` sets how far in front of the player the board appears (`Distance`, 1.2 m) and at which point of the bending-down animation (`At`). `Animation = false` puts the board down at once.

All item settings are listed on the [Configuration](/organized-chaos-docs/hoverboards/configuration.md#item) page.
