> For the complete documentation index, see [llms.txt](https://docs.cuxial.com/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.cuxial.com/scripts/core/cuxial-interactions.md).

# Cuxial Interactions

NPCs with dialogue and a selling shop for FiveM, plus an API so other resources can register their own.

Cuxial Interactions places NPCs in the world that talk to the player through a dialogue window and can buy items from them. Your other resources can register their own NPCs, dialogues and shops through exports, so every conversation on the server looks and behaves the same.

## What it does

* **NPCs defined in data files.** Each file in `data/` is a set of NPCs you switch on or off from the config.
* **Dialogues with pages and buttons.** A button can close, jump to another page, open the shop, run a function or trigger an event.
* **Selling shops.** The NPC buys items from the player. Prices, distance and quantity are checked on the server.
* **Conditions per NPC and per button**: job, minimum grade, items carried or your own function.
* **Camera on the NPC** while the conversation is open, with the player hidden.
* **NPCs with the look of real players.** A point can take the appearance of a random active character.
* **Map blips** per NPC.
* **API for other resources**: register a point with its own ped, attach a dialogue to a ped that already exists, or open a dialogue or a shop directly.
* **Automatic cleanup.** When a resource stops, its NPCs, dialogues and shops are removed.

## Requirements

| Resource                                         | Required    | Used for                                                                                                                    |
| ------------------------------------------------ | ----------- | --------------------------------------------------------------------------------------------------------------------------- |
| OneSync                                          | Yes         | Distance checks on the server                                                                                               |
| `ox_lib`                                         | Yes         | Callbacks, notifications, locales, spawn points                                                                             |
| `oxmysql`                                        | Yes         | Reading player appearances for NPCs with `usePlayerSkin`                                                                    |
| `ox_inventory`                                   | Yes         | Item counts, labels and images of the shop                                                                                  |
| `cuxial_bridge`                                  | Yes         | Connects to your framework (QBox, QBCore or ESX) and to your target resource                                                |
| `sleepless_interact`, `ox_target` or `qb-target` | One of them | The option the player aims at to talk to the NPC                                                                            |
| `cuxial_appearance`                              | No          | Dresses the NPCs that use `usePlayerSkin`. Without it they keep the base model                                              |
| `cuxial_medical`                                 | No          | Revives the player in the paid NPC medic service. Without it the service answers that it is unavailable and does not charge |
| `bl_sprites`                                     | No          | Enables `interaction = 'sprite'` (a key prompt on the NPC). Without it the point uses the target                            |

{% hint style="warning" %}
`usePlayerSkin` requires QBox or QBCore: it reads the tables `appearance` and `players`. On ESX, give those NPCs a `model`; a point without one spawns with `npc.fallbackModel`.
{% endhint %}

## Pages

<table data-view="cards"><thead><tr><th></th><th></th><th data-hidden data-card-target data-type="content-ref"></th></tr></thead><tbody><tr><td><strong>Installation</strong></td><td>Dependencies, convars and start order.</td><td><a href="/scripts/core/cuxial-interactions/installation.md">Installation</a></td></tr><tr><td><strong>Configuration</strong></td><td>Every option in <code>shared/config.lua</code> and how the NPC sets in <code>data/</code> work.</td><td><a href="/scripts/core/cuxial-interactions/configuration.md">Configuration</a></td></tr><tr><td><strong>Commands &#x26; permissions</strong></td><td>Keys of the dialogue and who can talk to each NPC.</td><td><a href="/scripts/core/cuxial-interactions/commands.md">Commands &amp; permissions</a></td></tr><tr><td><strong>Exports &#x26; events</strong></td><td>Register your own NPCs, dialogues and shops from another resource.</td><td><a href="/scripts/core/cuxial-interactions/developers.md">Exports &amp; events</a></td></tr><tr><td><strong>Troubleshooting</strong></td><td>Common problems and how to fix them.</td><td><a href="/scripts/core/cuxial-interactions/troubleshooting.md">Troubleshooting</a></td></tr></tbody></table>


---

# Agent Instructions
This documentation is published with GitBook. GitBook is the documentation platform designed so that both humans and AI agents can read, navigate, and reason over technical content effectively. Learn more at gitbook.com.

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

Perform an HTTP GET request on the following URL with the `ask` and `goal` query parameters:

```
GET https://docs.cuxial.com/scripts/core/cuxial-interactions.md?ask=<question>&goal=<user_goal>
```

`ask` is the immediate question: it should be specific, self-contained, and written in natural language.
`goal` is what the user is ultimately trying to achieve, the reason they need the answer. Sharing it helps GitBook give you a better, more relevant answer. A goal is most helpful when it describes the outcome the user wants rather than restating the question. For example, with `ask=how do I create an API token`, a goal like `automate deployments from our CI pipeline` lets GitBook tailor the answer to that use case.

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.
