> 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/exports.md).

# Exports

Exports and state bags for your own scripts.

The exports are in `client_exports.lua` and `server_exports.lua`. Both files are open: read them, change them, add exports of your own.

## Client

```lua
exports.hoverboard:isHoverboard(vehicle)  -- is this vehicle a hoverboard?
exports.hoverboard:isRiding()             -- is this player standing on one?
exports.hoverboard:getBoard()             -- the board they stand on, or nil
exports.hoverboard:getStance()            -- 'idle', 'lean_l', 'lean_r', 'tuck' or 'rise'; nil off a board
exports.hoverboard:hopOff()               -- takes them off at once; whether they were on one
exports.hoverboard:boost()                -- fires the boost, as the key does (the cooldown applies)
exports.hoverboard:pickUp(board)          -- picks up a board that came out of an inventory; false if it cannot be
exports.hoverboard:canPickUp(board)       -- whether this player can pick that board up right now
```

For example, to take players off their board in a no-ride zone:

```lua
if exports.hoverboard:isRiding() then
    exports.hoverboard:hopOff()
end
```

`pickUp` and `canPickUp` are for a target script other than ox\_target (`Config.Item.PickUp.Target = false`): show the option when `canPickUp` says so, and call `pickUp` when it is chosen. The player bends down for the board, and it goes back into their inventory. See [Items](/organized-chaos-docs/hoverboards/items.md).

## Server

```lua
exports.hoverboard:giveBoard(source, model)     -- puts a board in front of a player; model is optional
exports.hoverboard:putDownBoard(source, model)  -- the player bends down and sets a board down, as the item does
```

`model` is a spawn name from `Config.Models`. Without it the player gets the first. Both return `false` when that player is not on the server. Use `putDownBoard` for an inventory the script does not know (`Config.Item.Framework = false`); a board set down this way is nobody's item and cannot be picked up.

`useItem` is for ox\_inventory: give an item `server = { export = 'hoverboard.useItem' }` and it sets down the board that `Config.Item.Items` names for it.

## State bags

`Entity(vehicle).state.hoverboardRidden` is `true` while someone rides that board. `hoverboardPose` and `hoverboardBoost` on the same vehicle are the script's own: the rider's pose and a boost, for the other players. A board that came out of an inventory carries `hoverboardItem` (the item's name), `hoverboardOwner` (the server id of the player who set it down) and `hoverboardTaken` (whether the item left the inventory).
