# Chat System

{% embed url="<https://youtu.be/MS0w9HrY5MM?si=AFxc63xmF6jVgNsr>" %}

## Advanced Roleplay Chat System for FiveM

Transform your server's communication with our comprehensive roleplay chat system. Featuring modern NUI design, 3D text displays above players' heads, and a fully configurable command system for immersive roleplay experiences.

***

## &#x20;Features

#### Core Features

* **💬 Roleplay Commands** - ME, DO, TRY, MED with 3D text display
* **🎯 Smart Suggestions** - Auto-complete for commands
* **📡 Private Messaging** - PM and reply system
* **📢 Announcements** - Server-wide broadcasts
* **🎨 Customizable Design** - Colors, fonts, templates

#### NEW Features

* **⏱️ Cooldown System** - Anti-spam protection with per-command cooldowns
* **📝 Template System** - Predefined message templates (SYSTEM, ERROR, SUCCESS, INFO, WARNING, WELCOME)
* **📤 SendTemplate Export** - Send templates from other scripts

#### Advanced Features

* **🔌 Multi-Framework** - ESX, QB-Core, Standalone
* **📺 Streamer Mode** - Hide chat for streaming
* **📊 Discord Logging** - Webhook integration
* **🌍 Multi-Language** - Easy translation system
* **🖱️ Cursor Support** - Click-to-interact

***

## Command Types

| Type               | Description                        | Example Commands     |
| ------------------ | ---------------------------------- | -------------------- |
| **Distance-based** | Messages visible only within range | `/me`, `/do`, `/med` |
| **Global**         | Messages sent to all players       | `/globalooc`, `/ac`  |
| **Private**        | Direct messages between players    | `/w [id] [message]`  |
| **Report**         | Player reports to admins           | `/report [message]`  |
| **System**         | Server system messages             | Internal use         |
| **50/50 (TRY)**    | Random success/fail outcomes       | `/try [action]`      |

***

## Display System

| Feature                | Description                                  |
| ---------------------- | -------------------------------------------- |
| **Above Head Text**    | RP commands display text above player's head |
| **Distance Scaling**   | Text scales based on viewer distance         |
| **Custom Colors**      | Each command type has unique colors          |
| **Background Support** | Optional background behind 3D text           |
| **Fade Animation**     | Smooth fade out after duration               |
| **Stack Support**      | Multiple messages stack vertically           |

***

## Documentation

* [✅ README](https://scriptlock.gitbook.io/script-lock-docs/resources/chat-system) - This file
* [🔑 Installation](https://scriptlock.gitbook.io/script-lock-docs/resources/chat-system/installation) - Setup guide
* [🛠️ Configuration](https://scriptlock.gitbook.io/script-lock-docs/resources/chat-system/configuration) - Main config options
* [💬 Commands](https://scriptlock.gitbook.io/script-lock-docs/resources/chat-system/commands) - Chat commands setup
* [⚙️ Framework Bridge](https://scriptlock.gitbook.io/script-lock-docs/resources/chat-system/framework-bridge) - Framework integration
* [🗺️ Localization](https://scriptlock.gitbook.io/script-lock-docs/resources/chat-system/localization) - Multi-language support
* [📤 Exports](https://scriptlock.gitbook.io/script-lock-docs/resources/chat-system/exports) - Available exports
* [📋 Logs](https://scriptlock.gitbook.io/script-lock-docs/resources/chat-system/logs) - Discord webhook logging

***

## Links

* **Documentation:** [GitBook](https://scriptlock.gitbook.io/script-lock-docs)
* **Support:** [Discord](https://discord.gg/zZj4bNMuf7)
* **Store:** [Tebex](https://scriptlock.tebex.io/)
* **CFX Portal:** [portal.cfx.re](https://portal.cfx.re/assets/granted-assets)

***

## &#x20;File Structure

```
sl-chat/
├── cl_main.lua                    # Client-side main script
├── sv_main.lua                    # Server-side main script
├── fxmanifest.lua                 # Resource manifest
├── data/
│   └── language/                  # Translation files
│       ├── en.json
│       └── pl.json
├── dist/                          # Built NUI files
│   ├── index.html
│   ├── dui_text.html
│   └── assets/
├── modules/
│   ├── editable_client.lua        # Framework bridge (client)
│   ├── editable_server.lua        # Framework bridge (server)
│   ├── client/
│   │   ├── cursor.lua             # Cursor system
│   │   ├── display.lua            # 3D text display
│   │   ├── images.lua             # Streamer mode
│   │   └── suggestions.lua        # Command suggestions
│   ├── server/
│   │   ├── logs.lua               # Discord logging
│   │   └── translate.lua          # Server translations
│   └── shared/
│       ├── translate.lua          # Shared translations
│       └── utils.lua              # Utility functions
└── shared/
    ├── commands.config.lua        # Commands configuration
    ├── suggestions.config.lua     # Additional suggestions
    ├── logs.config.lua            # Logging configuration
    └── translate.config.lua       # Translation settings
```

***

## Pricing

**Price:** €23.70 + VAT

***

Developed with ❤️ by ScriptLock
