# Exports

## Functions

**`OpenDialog`**

Opens a dialog interaction with a specified NPC or entity, allowing players to select options from a customizable menu.

**Parameters:**

* **`data`**: A table containing the following fields:
  * **`ped`**: The NPC or entity to interact with.
  * **`pedName`**: A string representing the name of the NPC displayed at the top of the dialog.
  * **`info`** *(optional)*: A descriptive text providing additional context or information about the dialog.
  * **`options`**: A table of interaction options. Each option can define an action to take when selected.

**Usage:**

```lua
exports('OpenDialog', OpenDialog)
```

**Example:**

```lua
OpenDialog({ 
    ped = GetClosestPed(5.0), -- The NPC or entity to interact with
    pedName = 'Merchant', -- The name of the NPC
    info = 'Welcome to my shop! What would you like to do?', -- Optional dialog description
    options = { 
        { 
            label = 'Buy Items', -- Text for the interaction option
            onSelect = function() 
                print('You chose to buy items!') 
            end 
        }, 
        { 
            label = 'Sell Items', 
            onSelect = function() 
                print('You chose to sell items!') 
            end 
        }, 
        { 
            label = 'Leave', 
            onSelect = function() 
                print('You left the conversation.') 
            end 
        } 
    } 
})
```


---

# Agent Instructions: Querying This Documentation

If you need additional information that is not directly available in this page, you can query the documentation dynamically by asking a question.

Perform an HTTP GET request on the current page URL with the `ask` query parameter:

```
GET https://docs.vildstore.com/dialog-system/exports.md?ask=<question>
```

The question should be specific, self-contained, and written in natural language.
The response will contain a direct answer to the question and relevant excerpts and sources from the documentation.

Use this mechanism when the answer is not explicitly present in the current page, you need clarification or additional context, or you want to retrieve related documentation sections.
