Dialog
Library
Updated 2 months ago ·
v1.3.7The dialog system provides interactive NPC-style dialog with camera focus, branching responses, and metadata display.
lib.registerDialog
Register a dialog tree.
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | yes | Unique dialog identifier |
| data | table | yes | Dialog definition |
Dialog Data
| Field | Type | Description |
|---|---|---|
title | string | Dialog title |
dialog | string | Main dialog text |
icon | string | Optional icon |
entity | number | Optional ped/entity for camera focus |
responses | table | function | Dialog responses array or callback returning responses |
metadata | table | function | Optional metadata badges |
prevDialog | string | Previous dialog ID for back-navigation |
prevContext | string | Previous context menu ID for back-navigation |
clickSounds | boolean | Override click sounds |
hoverSounds | boolean | Override hover sounds |
disableFocus | boolean | Disable scripted camera focus |
Response Fields
| Field | Type | Description |
|---|---|---|
label | string | Button label |
action | function | Callback when selected |
dialog | string | Open another dialog |
context | string | Open a context menu |
dontClose | boolean | Keep dialog open after action |
lib.openDialog
Open a registered dialog.
| Parameter | Type | Required | Description |
|---|---|---|---|
| entity | number | no | Entity used for camera focus |
| id | string | yes | Registered dialog ID |
lib.closeDialog
Close one dialog by ID, or all open dialogs if no ID is provided.
| Parameter | Type | Required | Description |
|---|---|---|---|
| id | string | no | Dialog ID to close |
| keep_cam | boolean | no | Keep current dialog camera active |
Was this page helpful?
This page was last updated on 12 March 2026