> For the complete documentation index, see [llms.txt](https://atiysus-organization.gitbook.io/aty-scripts/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://atiysus-organization.gitbook.io/aty-scripts/restaurant-creator/developer/exports.md).

# Exports

All exports use the resource name **`aty_restaurant`**.

### Server exports

#### `RegisterDynamicConsumable(itemId, category)`

Register an item as useable/consumable at runtime (wires the framework's "use item" handler to the restaurant consumption flow).

```lua
exports.aty_restaurant:RegisterDynamicConsumable('my_custom_burger', 'general')
```

#### `HandleConsumption(src, itemName)`

Run the biometric consumption logic for a player (allergen checks, calorie/fat debuffs) for a given item. Useful if you consume items through your own flow but still want ATY's biometric effects.

```lua
exports.aty_restaurant:HandleConsumption(source, 'chocolate_cheesecake')
```

### Client exports

#### Notifications

```lua
-- type: 'success' | 'error' | 'info' | 'warning'
exports.aty_restaurant:ShowNotification(type, title, message)
```

#### Player hold state

| Export                      | Returns                                                  |
| --------------------------- | -------------------------------------------------------- |
| `IsHoldingFood()`           | `true` if the player is holding a food/prop item.        |
| `GetHoldingData()`          | `itemName, propType, stage` for the currently held food. |
| `IsHoldingMop()`            | `true` if holding the mop.                               |
| `IsHoldingTrash()`          | `true` if carrying a trash bag.                          |
| `IsCarryingPizzaBox()`      | `true` if carrying a (full) pizza box.                   |
| `IsCarryingEmptyPizzaBox()` | `true` if carrying an empty pizza box.                   |

```lua
if exports.aty_restaurant:IsHoldingFood() then
    local item, propType, stage = exports.aty_restaurant:GetHoldingData()
end
```

#### World queries

| Export              | Returns                                              |
| ------------------- | ---------------------------------------------------- |
| `GetWaitingNPCs()`  | Table of currently spawned/queued customer NPCs.     |
| `GetSpawnedTrash()` | Table of currently spawned pollution/trash entities. |

#### Management UI

```lua
-- Open the management dashboard for a given restaurant data table.
exports.aty_restaurant:OpenManagement(restaurantData)
```

### 3D DUI / panel engine (`cr3d`)

For advanced integrations, the embedded `cr3d` engine exposes a full prop-screen API — create panels attached to entities/bones, replace a model's screen texture with a DUI, and forward input:

`CreatePanel`, `DestroyPanel`, `AttachPanelToEntity`, `AttachPanelToBone`, `SetPanelUrl`, `SetPanelSize`, `SetPanelTransform`, `CreateReplaceTexture`, `SetReplaceTextureUrl`, `DestroyReplaceTexture`, `SendReplaceMessage`, `BeginFocus`, `EndFocus`, `SendReplaceMouseMove/Down/Up/Wheel`, and more.

These are the same primitives the microwave and espresso screens use. See `client/cr3d/` for the full surface.

{% hint style="info" %}
Prefer the high-level restaurant exports above for normal integrations. The `cr3d` API is for building your own prop-mounted DUIs.
{% endhint %}
