DiscordChatRoles [Release]

Documentation as well as updates to this resource have been moved to: DiscordChatRoles - Badger Docs


Version 1.0

This is a very simple script that uses IllusiveTea’s discord_perms for chat roles :slight_smile:

Picture example taken from my RP server:

You must set up IllusiveTea’s discord_perms script for this to work properly. —> Discord roles for permissions (im creative, i know)

Installation Tutorial

Example of how the chat roles are set up and what you should change:

	List in order of least priority to highest with 
	highest priority overtaking role before it if 
	they have that discord role.
roleList = {
{0, "^4Civilian | "}, -- 1
{577968852852539392, "^3Trusted Civ | "}, -- 2
{577661583497363456, "^2Donator | "}, -- 3
{577631197987995678, "^1T-Mod | "}, -- 4
{506211787214159872, "^1Mod | "}, -- 5
{506212543749029900, "^1Admin | "}, -- 6
{577966729981067305, "^6Management | "}, -- 7
{506212786481922058, "^5Owner | "}, -- 8

-- For allowing colored chat
allowedColors = {3, 4, 5, 6, 7, 8}
allowedRed = {4, 5, 6, 7, 8}

The 1s should be replaced with IDs of the respective roles in your discord server. (0 should stay for Civilian as it is the default role for all users)

  1. Download DiscordChatRoles from Dropbox
  2. Extract the .zip and place the folder in your /resources/ of your Fivem server
  3. Make sure you add “start DiscordChatRoles” in your server.cfg
  4. Enjoy :slight_smile:

My Other Work












Version 2.0
Chat colors can now be restricted to certain groups. The color red can also be restricted to only staff ranks!

Version 3.0

There is now a StaffChat for your staff members to use:

Permission to use /sc and /staffchat:


Version 4.0

Toggle off getting StaffChat messages (good for staff members if they are streaming their own RP)


/sc toggle

/staffchat toggle

Version 5.0

You can now change your chat-tags with the in-game command using /chattag and /chattag [id]

Version 6.0

You can now change your chat-color when you talk in-game using /cc or /chatcolor

/cc - List out the chat colors you have access to
/chatcolor - List out the chat colors you have access to
/chatcolor - Change chatcolor to the ID specified
/cc - Change chatcolor to the ID specified

How it works?
You basically set this up using a config in which the keys are the permission ACE value that gives them access to see and use those chat colors.

Config (you’ll have to find this in server.lua, in a future version I’ll move it to the top though):

local availColors = 
	['DiscordChatRoles.Access.Donator'] = {
		['White'] = {'^0'},
		['Green'] = {'^2'},
		['Yellow'] = {'^3'},
		['Blue'] = {'^4'},
		['Light Blue'] = {'^5'},
		['Purple'] = {'^6'},
		['White'] = {'^7'},
		['Pink'] = {'^9'},
		['Police'] = {'^1', '^4'},
		['Police2'] = {'^4', '^1'},
		['Christmas'] = {'^2', '^1'},
		['Christmas2'] = {'^1', '^2'},
	['DiscordChatRoles.Access.Elite'] = {
		['RainbowYGB'] = {'^3', '^2', '^4'},
		['RainbowFull'] = {'^3', '^4', '^1', '^5', '^6', '^7', '^9'},
	['DiscordChatRoles.Access.Staff'] = {
		['Red'] = {'^1'},

Following the format of the config, you can add multiple different permission for chat colors and set up a vast variety of different pattern combinations!

I hope you all enjoy! Merry Christmas to all! :slight_smile:



Please use the forum uploading feature, or, alternatively, upload to a GitHub repository.

May have remade the post on accident as I didn’t notice this getting unlisted. Apologies.

I cant get it funcionallity

What is not working? Have you set up discord_perms properly and put in the IDs of your discord roles correctly?

did you set that up?

1 Like

Support For /ooc Would Be Nice.

Oh yes I fixed that for my server, I can post the update for that fix later today if that works? :slight_smile:

Uploaded the download link to include the new version that fixes support for commands being ran :slight_smile: Let me know if you have any others issues/suggestions!

Yes, i setup that, but the chat dont detect me if i am Owner

Did you set up the role IDs as well? Show the roleList code in the server.lua file.

im having a small issue its working but putting me down as whatever is the first option as if its not detecting the role is this the correct setup? the guildid and discord token is correct i think :confused:

roleList = {
{1, "^3Trusted Civ | "},
{1, "^2Donator | "},
{1, "^1T-Mod | "},
{1, "^1Mod | "},
{1, "^1Admin | "},
{1, "^6Management | "},
{586689479008321712, "^6Owner | "},

Roles = {
		["Owner"] = "586689479008321712" -- This would be checked by doing exports.discord_perms:IsRolePresent(user, "TestRole")

What is the Roles list there for? I never had Roles list in my script. Are you sure the ID for your Owner role is correct?

thats from the resource you’re script requires does it not need to be setup for it to work?

Check console and see if the bot is being connected correctly. It should say something in console like "Guild Set To: "

yep i checked and it is connected to our discord server

Is your Steam connected to your discord account too? I don’t believe it’s an issue with my script since it works properly on my server. I would suggest making sure you set up the perms right and discord ID is correct for the rank Owner as well.

Will support for commands be added?