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

# Configuration

Everything is controlled from a single file: `config.lua`

### Framework & Language

```lua
Config.Framework = 'auto'   -- 'auto' | 'esx' | 'qbcore' | 'qbox' | 'ox' | 'nd' | 'standalone' | 'custom'
Config.Locale    = 'en'     -- See supported languages above
```

### Keybinds

```lua
Config.OpenKey  = 'T'
Config.CloseKey = 'ESCAPE'
```

### Channels

```lua
Config.Channels = {
    local_distance = 15,     -- Proximity range (GTA units)
    enable_global  = true,
    enable_staff   = true,
}
```

### Chat Settings

```lua
Config.Chat = {
    max_messages     = 200,
    max_length       = 500,
    allow_edit       = true,
    fade_enabled     = true,
    fade_timeout     = 5,
    show_timestamps  = true,
    show_player_ids  = true,
    show_avatars     = true,
    show_emoji_button  = true,
    show_gif_button    = true,
    show_games_button  = true,
}
```

### Rate Limiting

```lua
Config.RateLimit = {
    min_interval       = 1,
    burst_limit        = 3,
    burst_window       = 3.0,
    cooldown_duration  = 5,
    escalation_factor  = 2,
    max_escalation     = 60,
}
```

### Staff Groups

```lua
Config.StaffGroups = {
    esx    = { 'admin', 'superadmin', 'god' },
    qbcore = { 'admin', 'god' },
    ox     = { 'admin', 'superadmin' },
    nd     = { 'admin', 'superadmin', 'god' },
    ace    = 'chat.staff',
}
```

For Ace permissions add to `server.cfg`:

```cfg
add_ace group.admin chat.staff allow
```

### 3D / 2D Indicators

```lua
Config.Indicators = {
    MeDo3D = {
        enable          = true,
        display_time    = 5000,
        distance        = 20,
        los_check       = true,
        bubble_max_stack = 3,
    },
    MeDo2D = {
        enable = false,
    },
    Typing = {
        enable       = true,
        show_to_self = true,
        distance     = 15,
    },
}
```

### Profanity Filter

```lua
Config.ProfanityFilter = {
    enabled     = false,
    replacement = '***',
    words       = { 'word1', 'word2' }
}
```

{% hint style="info" %}
Can also be managed live from the Admin Panel.
{% endhint %}

### Exports

```lua
-- Send a message from another script
exports['fb-chat']:SendMessage('global', 'system', 'Restart in 10 min!', 'System')

-- Get server chat statistics
local stats = exports['fb-chat']:GetStats()
print('Messages: ' .. stats.totalMessages)
print('Players:  ' .. stats.activePlayers)
```

### Commands

| Command          | Description                         |
| ---------------- | ----------------------------------- |
| `/ooc`           | Out-of-character message            |
| `/me`            | Roleplay action — 3D indicator      |
| `/do`            | Describe environment — 3D indicator |
| `/try`           | Attempt an action — success/fail    |
| `/staff`         | Staff-only message                  |
| `/announcement`  | Server-wide announcement            |
| `/roll`          | Roll 1–100 with animation           |
| `/coin`          | Flip a coin with animation          |
| `/dice`          | Roll two dice with animation        |
| `/adminchat`     | Open the admin panel                |
| `/w [id] [msg]`  | Whisper to a player                 |
| `/pm [id] [msg]` | Private message to a player         |

{% hint style="info" %}
Slash-free mode: typing `me sits down` auto-converts to `/me sits down`
{% endhint %}

***

### Admin Panel

Open with `/adminchat` — requires staff permission.

| Tab           | Function                                             |
| ------------- | ---------------------------------------------------- |
| Chat Log      | Searchable history with type, channel & time filters |
| Players       | Online roster with quick warn / mute / kick          |
| Stats         | Server metrics, message counts, performance data     |
| Live Feed     | Real-time message stream                             |
| Announce      | Broadcast server-wide announcements                  |
| Mod Log       | Full moderation action history                       |
| Reports       | Player-submitted reports with resolve/dismiss        |
| Auto Messages | Scheduled recurring announcements                    |
