> For the complete documentation index, see [llms.txt](https://striga.gitbook.io/docs/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://striga.gitbook.io/docs/striga-chat/installation-and-configuration.md).

# Installation & Configuration

Install Striga Chat and set it up in editable/config.lua.

{% stepper %}
{% step %}

### Add the resource

Put the `striga-chat` folder in your `resources` folder, for example next to `striga-core` in `[striga]`. Do not rename the folder.
{% endstep %}

{% step %}

### Remove the default chat

In `server.cfg`, delete or comment out this line:

```
# ensure chat
```

If your config has `set resources_useSystemChat true`, change it to:

```
set resources_useSystemChat false
```

{% hint style="warning" %}
Never run the default chat and Striga Chat at the same time. You get two chat windows and every message twice.
{% endhint %}
{% endstep %}

{% step %}

### Start it in server.cfg

Start `striga-core` **first**, after ox\_lib, oxmysql and your framework. Then start the chat:

```
ensure oxmysql
ensure ox_lib
ensure qb-core        # or qbx_core / es_extended
ensure striga-core
ensure striga-chat
```

If you start by folder (`ensure [striga]`), make sure that folder starts after your framework. Striga Chat waits for oxmysql by itself.

{% hint style="warning" %}
Striga Chat needs **striga-core 0.1.0 or newer**.

* No striga-core: Striga Chat does not start.
* striga-core too old: striga-core stops Striga Chat and prints a red error in the server console. Update striga-core.
  {% endhint %}
  {% endstep %}

{% step %}

### Restart the server

Restart the whole server. The database table `striga_chat_logs` is made by itself.
{% endstep %}
{% endstepper %}

{% hint style="info" %}
striga-core checks GitHub for updates and prints a red `UPDATE` line with the download link when a new version is out. Turn it off with `"versionCheck": false` in `striga-core/config.json`. See [Updates & Versions](/docs/updates-and-versions.md).
{% endhint %}

***

## Why `exports.chat` still works

Scripts like Qbox call `exports.chat:addMessage(...)`. Striga Chat says it **provides** `chat` and answers those calls, so those scripts need no edit. Just make sure the real `chat` resource is not started.

***

## Config

File: `editable/config.lua`. Channels and RP commands have their own page: [Channels & Commands](/docs/striga-chat/channels-and-commands.md).

### General

| Option                    | Default        | What it does                                                                                                                                                    |
| ------------------------- | -------------- | --------------------------------------------------------------------------------------------------------------------------------------------------------------- |
| `Config.Locale`           | `'auto'`       | `'auto'` = striga-core server language (`config.json` `locale`, live `/strigalocale <code>`); a code (en, tr, de, es, fr, it, nl, pl, pt, ru, ar) pins the chat |
| `Config.OpenKey`          | `'T'`          | Default key to open the chat. Players can rebind it in the FiveM key settings                                                                                   |
| `Config.ToggleCommand`    | `'togglechat'` | Command that switches `whenactive` / `visible` / `hidden`. Saved per player                                                                                     |
| `Config.Cursor`           | `true`         | Mouse cursor while typing. `false` = keyboard only                                                                                                              |
| `Config.MaxLength`        | `256`          | Max characters per message. Longer ones are cut                                                                                                                 |
| `Config.RequireCharacter` | `true`         | Players need a loaded character to write (commands still work)                                                                                                  |
| `Config.AllowColorCodes`  | `false`        | Allow `^1` style color codes in player messages                                                                                                                 |
| `Config.ShowServerId`     | `true`         | Show the server ID next to names                                                                                                                                |
| `Config.JoinLeave`        | `false`        | "X joined / left" lines. The convars `chat_showJoins` / `chat_showQuits` still apply                                                                            |
| `Config.Currency`         | `'$'`          | Money sign in ad messages                                                                                                                                       |
| `Config.UseChannels`      | `false`        | `true` = channel tabs. `false` = commands only                                                                                                                  |
| `Config.DefaultChannel`   | `'general'`    | Where messages go when the player writes in the "All" tab                                                                                                       |
| `Config.RpRange`          | `20.0`         | Meters for `/me`, `/do`, `/try`, `/roll`, `/looc` (needs OneSync)                                                                                               |

### Look (`Config.Ui`)

| Option                | Default                  | What it does                                                                |
| --------------------- | ------------------------ | --------------------------------------------------------------------------- |
| `Accent`              | `'#f43f5e'`              | Main color when there is no HUD theme and the player picked none            |
| `Position`            | `'top-left'`             | Default spot, see the positions below                                       |
| `OffsetX` / `OffsetY` | `24`                     | Distance from the screen edge (px at 1080p)                                 |
| `Width`               | `560`                    | Chat width (px at 1080p)                                                    |
| `Height`              | `360`                    | Height of the message list while open (px at 1080p)                         |
| `Lines`               | `8`                      | Lines shown while the chat is closed                                        |
| `FadeAfter`           | `10`                     | Seconds a new line stays while the chat is closed                           |
| `MaxMessages`         | `200`                    | Messages kept in the window                                                 |
| `Radius`              | `10`                     | Corner radius, 0 (square) to 20 (round)                                     |
| `Opacity`             | `50`                     | Card opacity, 30 to 100                                                     |
| `Blur`                | `8`                      | Blur behind cards, input and buttons, 0 to 16 (0 = off). Costs a little GPU |
| `Timestamps`          | `true`                   | Time on each line                                                           |
| `InputTag`            | `true`                   | Tag at the left of the input (channel, ME / DO, "Command")                  |
| `Visibility`          | `'whenactive'`           | Default for players who never used `/togglechat`                            |
| `Style`               | `'card'`                 | `card`, `tinted`, `compact`                                                 |
| `Settings`            | `true`                   | `false` = players cannot change anything                                    |
| `Emoji`               | `true`                   | Emoji button with categories and search                                     |
| `QuickButtons`        | `{ 'me', 'do', 'roll' }` | Buttons under the input (keys from `Config.Commands`). `{}` hides them      |

**Positions:** `top-left`, `top-center`, `top-right`, `middle-left`, `center`, `middle-right`, `bottom-left`, `bottom-center`, `bottom-right`

### Player settings

The `Config.Ui` values are the **defaults**. Players change them for themselves in two places. Both change the same settings:

* The chat's own **settings panel** (button next to the input). Without Tokyo HUD it also has a position picker with 9 spots.
* The **Tokyo HUD `/hud` menu**, **Chat** section (when the HUD runs, through the striga-core settings hub). With the HUD, the chat is moved in the HUD editor.

Set `Config.Ui.Settings = false` to lock them. Everyone then sees your config values.

### Color priority

The color follows the HUD theme unless the player picks a color.

1. The color the player picked in the chat settings
2. The Striga Tokyo HUD theme color (if the HUD runs)
3. `Config.Ui.Accent`

### Lines over the head (`Config.Bubbles`)

`/me`, `/do`, `/try` and `/roll` also show over the author's head for the players who get the chat line. Hidden behind walls and beyond `Distance`.

| Option       | Default                   | What it does                                                             |
| ------------ | ------------------------- | ------------------------------------------------------------------------ |
| `Enabled`    | `true`                    | Default for players. Each player can turn it off in the settings         |
| `Kinds`      | `me`, `do`, `try`, `roll` | Which commands get a line over the head                                  |
| `Duration`   | `7`                       | Seconds a line stays                                                     |
| `Distance`   | `15.0`                    | Meters from which lines are visible                                      |
| `MaxLines`   | `3`                       | Lines over one head. Older ones go first                                 |
| `Renderer`   | `'nui'`                   | `'nui'` = card look. `'native'` = game text, lowest resmon, plainer look |
| `UpdateRate` | `30`                      | `'nui'` only: head positions per second, 10 to 60                        |
| `Size`       | `1.0`                     | Size of the lines, 0.5 to 3                                              |
| `Font`       | `2`                       | GTA font for `'native'`                                                  |

### Spam guard (`Config.Spam`)

`Messages = 5` per `Window = 5000` ms per player, for chat lines and RP commands. More shows "Slow down" and the extra messages are dropped.

### History and logging

| Table            | Option             | Default | What it does                                   |
| ---------------- | ------------------ | ------- | ---------------------------------------------- |
| `Config.History` | `Enabled`          | `true`  | Players see the latest messages when they join |
|                  | `Size`             | `50`    | Lines per channel (max 500)                    |
|                  | `LoadFromDatabase` | `true`  | Fill history from the log after a restart      |
| `Config.Logging` | `Enabled`          | `true`  | Write chat lines in `striga_chat_logs`         |
|                  | `Commands`         | `true`  | Also log RP commands                           |
|                  | `KeepDays`         | `30`    | Older rows are deleted. `0` = keep forever     |

### Texts (`Config.Text`)

Change one game text without touching the language file:

```lua
Config.Text = { tooFast = 'Easy there!' }
```

Keys come from the `game` section of `editable/locales/en.json`.

***

## With Tokyo HUD

When Striga Tokyo HUD runs, there is nothing to set up:

* The chat uses the HUD theme color until a player picks a chat color.
* In the HUD editor (`/hud` > Edit HUD) the chat shows as a box. Drag it to move the chat, click it to change its settings, or put it back at its config spot.
* The `/hud` menu has a **Chat** settings section. See [Settings Menu (/hud)](/docs/striga-tokyo-hud/settings-menu.md).

Restart `striga-chat` after updating both resources.

***

## Translate

Copy `editable/locales/en.json` to `<code>.json`, translate the values (keep the `{placeholders}`) and set striga-core's `locale` (or `Config.Locale` to pin the chat). Missing keys fall back to English.

{% content-ref url="/pages/5ydNIEBqoDa0a5UL7aeB" %}
[Channels & Commands](/docs/striga-chat/channels-and-commands.md)
{% endcontent-ref %}


---

# 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://striga.gitbook.io/docs/striga-chat/installation-and-configuration.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.
