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

# Installation

Install Cuxial Interactions step by step: dependencies, example sets, convars and start order.

Cuxial Interactions needs no SQL import and adds no inventory items. It creates no tables.

{% stepper %}
{% step %}

## Check the dependencies

These resources must be installed and working first:

* `ox_lib`
* `oxmysql`
* `ox_inventory`
* `cuxial_bridge`, with one of the supported frameworks: QBox, QBCore or ESX
* A target resource: `sleepless_interact`, `ox_target` or `qb-target`
* OneSync enabled on the server

Optional resources:

* `cuxial_appearance` dresses the NPCs that use `usePlayerSkin`.
* `cuxial_medical` is called by the paid NPC medic service to revive the player.
* `bl_sprites` enables the key prompt mode (`interaction = 'sprite'`).

{% hint style="warning" %}
`usePlayerSkin` requires QBox or QBCore. On ESX those NPCs spawn with their `model`, or with `npc.fallbackModel`.
{% endhint %}
{% endstep %}

{% step %}

## Copy the resource

Place the `cuxial_interactions` folder inside your `resources` directory. Keep the folder name as it is: other resources call its exports by that name.
{% endstep %}

{% step %}

## Review the example sets

The package includes three example sets: `Greeter`, a guide with a dialogue of several pages in Legion Square; `Buyer`, an NPC that buys items in Vinewood; and `Doctor`, the paid NPC medic in Sandy Shores, which is off by default. Change their coordinates, texts and items, or turn them off and write your own.

Open `shared/config.lua` and leave on only the sets you want:

{% code title="shared/config.lua" %}

```lua
sets = {
    Greeter = true,   -- data/Greeter.lua is loaded
    Buyer = true,     -- data/Buyer.lua is loaded
    Doctor = false,   -- data/Doctor.lua is ignored
},
```

{% endcode %}

{% hint style="info" %}
A button that calls a resource you do not have does not break anything: it leaves a warning in the client console and the dialogue keeps working. Turn the set off, or edit the button, to keep the console clean.
{% endhint %}

The items a shop buys must exist in `ox_inventory`. The texts of the example NPCs are written in the data files, not in `locales/`.
{% endstep %}

{% step %}

## Set the convars

Both are optional.

{% code title="server.cfg" %}

```cfg
# Language of the interface and the notifications (en and es are included)
setr ox:locale "en"

# Debug traces in the console
setr cuxial_interactions_debug "0"
```

{% endcode %}

{% hint style="info" %}
Use `setr`, not `set`: the debug convar is read on the client as well as on the server.
{% endhint %}
{% endstep %}

{% step %}

## Start the resource

Start it after its dependencies, after your framework and after your target resource. Resources that register their own NPCs go after it.

{% code title="server.cfg" %}

```cfg
ensure ox_lib
ensure oxmysql
# your framework here (qbx_core, qb-core or es_extended)
ensure ox_inventory
ensure cuxial_bridge
# your target resource (sleepless_interact, ox_target or qb-target)
ensure ox_target
# optional
ensure cuxial_appearance
ensure cuxial_medical
ensure cuxial_interactions
# resources that register NPCs through the exports go here
```

{% endcode %}
{% endstep %}

{% step %}

## Check that it works

1. Join the server and go to the coordinates of an NPC from a set you left on.
2. Within 60 metres the NPC appears. Aim at it with your target: the option to talk shows up.
3. Select it. The camera moves to the NPC and the dialogue opens.
4. Press <kbd>1</kbd> to pick the first button, or <kbd>Esc</kbd> to close.
5. If the NPC has a shop, open it and sell one item. The item leaves your inventory and the money arrives.
   {% endstep %}
   {% endstepper %}

Next: adjust the behaviour and write your own NPCs in [Configuration](/scripts/core/cuxial-interactions/configuration.md).


---

# 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/installation.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.
