[QB, QBOX, ESX] Roleplay Chat, Theme ++ [Updated]

Introducing the roleplay chat for FiveM inspired from SA:MP, a comprehensive chat system that enhances the communication experience in your FiveM server. This script provides several commands, including /me, /do, /ooc and /dice, along with additional features to enrich player interactions and improve roleplaying scenarios.

FEATURES :nail_care:t2:


  • Stay Anon: If you are wearing a mask or any helmet that hides your face, your character’s name will not be visible in the chat.
  • Configurable Proximity: Commands have a proximity range that can be adjusted in the config file.
  • Clear Chat: Clear chat command for user and staff team.
  • Stylish :sunglasses:: Who doesn’t appreciate a simple and elegant design? Plus, the ability to customize your chat strings adds even more flexibility.
  • Customizable Commands: You have the flexibility to customize any command, including their associated help texts.
  • Anti-Spam: You can customize the frequency at which players can send messages to prevent spamming.
  • Same Emote: You have the option to configure whether players can repeatedly use the same command or emote.
  • Join/Leave Messages: You can toggle join and leave messages in config file.
  • Chat Sounds: Sends a tick sound effect(native) if chat visible or visible when active.
    (If player hides the chatbox, it does not.)
  • Drawable Masks: You’ll able to add clothes like masks, it will hide your name in chat.
    Update 02.24.2024:
  • 3D Hologram Emote: 3D Hologram emotes now updated.
  • Collusion: If emote sender is behind a collusion for receiver, it won’t show receiver the hologram and chat message.

EXAMPLE :framed_picture:


image



TO-DO :hammer_and_wrench:


  • :white_check_mark: 3D Text: We will make a 3D hologram text that includes players’ emotes displayed on their ped.
  • [SUG] Typing: We may consider adding animated dots above players’ heads while the chat box is open…
    (If this feature is suggested, we will implement it and provide a toggle option for users to enable or disable it)
  • :white_check_mark: Drawable Masks: You will have the option to add clothing components, drawables such as masks, which will hide your name in the chat…
    (We have already implemented this feature while working on the topic)
  • Changeable Chat Style: You will have the ability to customize the chat style, including options such as displaying names, IDs, or leaving the name empty.
    (Current is name type)

LINKS :link:

Tebex Store (7$)

CONFIG FILE

CONFIG

return {
    -- Main configuration
    Framework = 'auto',                             -- 'auto' or 'custom' 
    PlaySound = true,                               -- Sends a tick sound effect(native) if chat visible or visible when active. (If player hides the chatbox, it does not.) (default: true)
    EnableJoinMessage = false,                      -- Enables join/leave message. Change it to the false for disable. (default: false)
    DisableChat = true,                             -- Toggle chat, you can leave it at true. You can still use the commands (all). (default: true)
    DisableEmoteEntry = false,                      -- Toggle the /me /do emote write on chat as entry (default: false)
    EmoteVisibilityCollusion = true,                -- Toggle emotes visibility collision (default: true)
    EmoteShowTime = 10000,                          -- you know the drill (3D emote)
    EmoteCooldown = 2,                              -- Cooldown for command usage (seconds)
    ForceCapital = true,                            -- a-A

    CommandOptions = {
        ['me'] = {
            proximity = 20,
            help_text = 'It indicates the movement and action of the character.',
            color = '#F2A2DA',
            args = {
                name = 'Action',
                help = 'You can use your action without the *Person* suffix.',
            },
            draw = {
                enabled = true,
                bone = 12844,       -- Head
                offset = vec3(0.0, 0.0, 0.4)
            },
            permission = 'group.user'
        },

        ['do'] = {
            proximity = 20,
            help_text = 'It indicates the character\'s situation and thoughts.',
            color = '#33CCFF',
            args = {
                name = 'Status',
                help = 'You can use your status without the *Person* suffix.',
            },
            draw = {
                enabled = true,
                bone = 11816,       -- Pelvis
                offset = vec3(0.0, 0.0, 0.3)
            },
            permission = 'group.user',
        },

        ['ooc'] = {
            proximity = 10,
            help_text = 'Out of character message.',
            color = '#DBFFFF',
            args = {
                name = 'Message',
                help = 'Your OOC message.',
            },
            draw = {
                enabled = false,
                bone = nil,
                offset = nil
            },
            permission = 'group.user',
        },
    },

    Dice = {
        command = 'dice',
        proximity = 10,
        help_text = "Throws a dice.",
        color = '#FFFFFF',
        args = {
            ['min'] = 1,
            ['max'] = 60,
        },
        draw = {
            enabled = true,
            bone = 11816,       -- Pelvis
            offset = vec3(0.0, 0.0, 0.3)
        },
    },

    ClearChat = {
        ['Self Chat Box'] = {
            command = 'clearchat',
            helptext = 'Clear chat for yourself'
        },

        ['Server Chat Box'] = {
            command = 'ccall',
            permission = 'group.admin',
            helptext = 'Clear chat for everyone'
        }
    },

    -- Please exclude IDs from being considered as masks within the 'MASK/BEARD' category.
    BlacklistedMasks = {
        ['mp_m_freemode_01'] = {1, 2, 3},           -- Male blacklisted masks.
        ['mp_f_freemode_01'] = {1, 2, 3}            -- Female blacklisted masks.
    },

    -- For props like helmet, glasses and others
    -- Check for prop ids, or just ask in our Discord server.
    -- Example usage: ["1"] = {1},
    ExtraPropMasks = {
        ['mp_m_freemode_01'] = {
            ['0'] = {50, 51, 52, 53},           -- Hats/Helmets
            -- ['3'] = {1, 2}
        },

        ['mp_f_freemode_01']= {
            ['0'] = {49, 50, 51, 52},           -- Hats/Helmets
            -- ['1'] = {}
        }
    },

    -- For other categories just check drawable id and put it inside the list.
    -- Check for drawable component ids, or just ask in our Discord server.
    -- Same usage with `ExtraPropMasks`.
    -- https://forum.cfx.re/t/how-to-streaming-addon-clothes-and-ped-props-for-mp-freemode-models/458854
    ExtraDrawableMasks = {
        ['mp_m_freemode_01'] = {
            -- ['0'] = {},
            -- ['1'] = {}
        },
        ['mp_f_freemode_01']= {
            -- ['0'] = {},
            -- ['1'] = {}
        }
    },

    Locales = {
        ['me'] = "* %s: %s",
        ['do'] = "* [%s] %s",
        ['ooc'] = "(( %s: %s ))",
        ['dice'] = "%s rolls a dice and it lands on %d.",
        
        ['anon_name'] = "Anonymous",
        ['spam_message'] = "You can emote in every %s seconds."
    }
}

For any questions or support join our Discord server. :sunglasses:

Code is accessible Partial (Config file)
Subscription-based No
Lines (approximately) 300~
Requirements QBCore Framework, ox_lib
Support Yes
9 Likes

Updated. ++

E(Q5HTA0X1OI$G4WQGF4
Is it possible to modify the message displayed by /me ​​or /do to be displayed above the player’s head?
like this↓
50A{WCF8B%BX`TIN9FCQPY

I will make it configurable. Thanks for suggestion.

Has it been updated?

Not yet, you can check updates by joining discord server. You can make suggestions.

Updated+

+ New file order.
+ Most of the parts are re-written.
+ Added standalone and ESX support suggestion by @xeunoiax
+ Added 3D text positions by bone coords.
+ Added toggleable 3D texts for each command.

- Removed unnecessary lines.
- Removed extra checks for strings.

This feature is available in the new update, within the offset of the player’s bone coordinates.

it still says Anonymous even when I don’t have a mask or anything, notice it’s only doing it for me and my admins. Can I have assistance/recommedations?

Dear author, I greatly appreciate your work and have purchased it for my server. I require the unencrypted version with Chinese voice, and would appreciate if you could send it to me

Send me DM with a screenshot or a video please :slight_smile:

ok i did thank you

How do I change the name of the server entry prompt to the role’s RP name?

The RP Chat theme has been completely rewritten from scratch! It will be available on the portal

Here’s whats new:

+ Added native texture support for the typing indicator.
+ Introduced a `commands.lua` file for better usability.
+ Some features now utilize statebags.
+ Added /pm and /r commands.
+ Shared file structure has been updated.
+ Message formats can now be customized via command options.

I will edit the topic later.

New Update

We’ve been working hard on this one! This update brings a complete overhaul to our roleplay chat system.
The 3D text that appears above players’ heads when using /me, /do and other RP commands has been completely rewritten from scratch.

But that’s not all! We’ve added a mask detection system that many of you have been asking for. When a player is wearing a mask, their character name will be hidden and replaced with “Masked Person” in chat messages. Perfect for those intense criminal RP scenarios where anonymity matters. Don’t worry though - real names are still logged to Discord for moderation purposes.

The entire configuration system has been redesigned with a placeholder system. You can now fully customize how messages appear using placeholders like {cname}, {id}, {message}, {job} and many more. Want your /me to show “[ID] Name does something” instead of “Name does something”? Just change the format string - no code editing required!

We’ve also added some nice quality-of-life features: a typing indicator so you can see when nearby players are writing something, optional sound notifications, automatic first-letter capitalization for cleaner looking RP, and join/leave announcements. The entire codebase has been cleaned up and we’ve included full documentation for server owners.

+ [ADDED] Placeholder system - fully customizable message formats.
+ [ADDED] Mask detection system - masked players appear as "Masked Person" in chat.
+ [ADDED] Typing indicator - see when nearby players are typing.
+ [ADDED] Sound notifications when receiving chat messages.
+ [ADDED] Auto capitalization for cleaner roleplay messages.
+ [ADDED] Join/Leave server announcements.
+ [ADDED] Per-command text scale for 3D text.
+ [ADDED] New locale keys for masks and join/leave messages.
- [REMOVED] Old entity-based statebag system (replaced with player statebags).
* [CHANGED] 3D text now uses Player Statebags for reliable sync.
* [CHANGED] Text rendering switched to SetDrawOrigin (no more flickering).
* [CHANGED] New messages automatically cancel previous ones (no text stacking).
* [CHANGED] Dice command now respects mask detection.
* [CHANGED] Duration and scale moved inside text3D block for consistency.
* [CHANGED] All code comments translated to English.
[FIXED] 3D text not appearing when using the same command twice.
[FIXED] Text jitter/flickering when player moves.
[FIXED] Statebag synchronization issues between clients.