CB Chat
A standalone roleplay chat replacement for RedM with channel filtering, 3D roleplay text, typing indicators, player-specific appearance settings, and compatibility with the standard Cfx chat events.
Current resource version: 1.0.1
Framework: Standalone
Dependencies: None
Features
- All, Me/Do, and Newspaper channel tabs
/meand/doworld-space text above characters- Live typing indicator
- Per-player colours, scale, and draggable position stored in resource KVP
- Responsive NUI for common resolutions and ultrawide displays
- Command suggestions and command history
- Five-message on-screen history limit
- Cfx-compatible chat themes and message events
Installation
- Copy the inner
cb-chatdirectory to your resources folder. - Disable the stock
chatresource or any other replacement chat. Two active chat UIs will conflict. - Add
ensure cb-chattoserver.cfg. - Restart the server, or run
refreshfollowed byensure cb-chat.
Controls and commands
| Input | Action |
|---|---|
T | Open chat using the standard chat key mapping. |
Enter | Send the current message. |
Esc | Close without sending. |
Up / Down | Navigate sent-message history. |
Page Up / Page Down | Scroll visible messages. |
/me <action> | Local roleplay action and white 3D text. |
/do <description> | Local scene description and red 3D text. |
/ooc <message> | Out-of-character message. |
/newspaper <text> | In-character newspaper broadcast. |
/clearchat | Clear the local player's chat window. |
/say <message> | Broadcast a plain message; also usable from the server console. |
Standard chat events
CB Chat listens for the familiar Cfx chat events, so existing scripts can integrate without depending on its NUI internals.
TriggerClientEvent('chat:addMessage', source, {
color = { 255, 255, 255 },
multiline = true,
args = { 'Server', 'Welcome to the server.' }
})Supported client events include chat:addMessage, chat:addSuggestion, chat:addSuggestions, chat:removeSuggestion, chat:addTemplate, and chat:clear.
TriggerClientEvent('chat:addSuggestion', source, '/example', 'Example command', {
{ name = 'value', help = 'Value to submit' }
})Customization
The shipped html/ folder is generated. Edit the React/Next.js source under nui/, not the generated output.
| Area | Location |
|---|---|
| Layout, fonts, and CSS variables | nui/app/globals.css |
| Tabs, defaults, message limit, bubble lifetime | nui/lib/config.js |
| Server command formatting | server/commands.lua |
| 3D range and projection | client/cl_chat.lua |
| Settings icon | nui/public/img/preloader.png |
After changing the NUI:
cd nui
npm install
npm run buildCommit and distribute the rebuilt html/ directory with the resource.
Chat themes
Other resources may declare a chat_theme metadata block. CB Chat supports injected stylesheets, styles, scripts, and message templates. Legacy stock-chat DOM template overrides are not supported.
Troubleshooting
Chat opens twice
Disable the stock chat resource and any other chat replacement.
UI edits do not appear
Rebuild the NUI and confirm the updated files were copied into html/. Editing nui/ alone does not change the in-game resource.
Commands do not appear in suggestions
Restart the affected resource or CB Chat so the client refreshes registered command suggestions.
Settings reset
Settings are stored per client with resource KVP. Renaming the resource or clearing client storage creates a fresh settings profile.

