FiveM scripts · Cortex Chat

Cortex Chat configuration reference

Every config.lua option with its default: cooldowns, flood lock, slur filter, roleplay commands, dice, position, and /dv.

8 sections · 4 min read

Where settings live

config.lua is shared by the client and server. Restart cortex-chat after editing it. /dv permission providers live separately in server/permissions_config.lua.

Config.Chat.FadeTimeout, Config.Chat.MaxMessages, and Config.Position.Side set starting values. Players can change fade time, history length, and position for themselves in Cortex Settings.

Out-of-range values are clamped to the bounds listed below.

Chat behavior

With ForceCommand = false, input starting with / runs as a command. So does input whose first word matches a registered command, so help works without a slash. Anything else is sent as a chat message.

KeyDefaultEffect
Config.Chat.ForceCommandfalsetrue runs every submission as a command for all players.
Config.Chat.MaxMessages50Messages kept before the oldest is removed. 10 to 200.
Config.Chat.FadeTimeout8000Milliseconds before messages fade in Active mode. 1000 to 60000. Announcements stay twice as long.
Config.Chat.OpenKey'T'Default key for the Open Chat mapping. Players who already have a binding keep it.
Config.Chat.EnableSuggestionstrueShows command suggestions while typing.
Config.Chat.MaxSuggestions5Suggestions shown at once. 1 to 20.
Config.Chat.ShowServerPrintfalseForwards server console prints to chat as system notices.
Config.Chat.ServerPrintDedupeMs2000Hides an identical server print repeated within this many milliseconds. 0 disables the check.
Config.Chat.ServerPrintBlockedPatternsResource start, stop, and scan patternsLua patterns, matched without case, that are never forwarded.

Cooldown, flood lock, and word filter

The server enforces these limits. The cooldown and flood lock cover normal chat, /me, /gme, /ooc, and /rolldice. With the defaults, a fourth send within 10 seconds is blocked and locks that player's chat for 60 seconds.

Messages are cleaned on the server and cut to 300 characters. The slur filter replaces matches with ******. It is a word and phrase list, not a guarantee against every spelling trick.

config.lua
SlurFilterExtra = {
    'examplebadword',
    'three word phrase',
},

KeyDefaultEffect
Config.Chat.MessageCooldownMs350Minimum milliseconds between sends per player. 0 disables it.
Config.Chat.SpamPrevention.EnabledtrueTurns the flood lock on or off.
Config.Chat.SpamPrevention.MessageThreshold4Sends within the window that trigger the lock. Minimum 2.
Config.Chat.SpamPrevention.WindowMs10000Counting window in milliseconds. Minimum 1000.
Config.Chat.SpamPrevention.LockDurationMs60000Lock length in milliseconds. Minimum 1000.
Config.Chat.SpamPrevention.LocalWarningMessage'^1Spam prevention:^0 too many messages. Chat locked briefly. (only you see this)'Shown only to the locked player. false disables it.
Config.Chat.SlurFiltertrueServer-side slur filter. false disables it.
Config.Chat.SlurFilterExtra{}Extra words or phrases to filter. Phrases must contain a space.

Position

Offsets are scaled with screen height, so the same values work across resolutions.

KeyDefaultEffect
Config.Position.Side'left''left' starts chat at the top left and 'right' at the top right. Players can choose another corner.
Config.Position.OffsetX20Distance from the side edge in design pixels, scaled with the UI. 0 to 100.
Config.Position.OffsetY20Distance from the top or bottom edge in design pixels, scaled with the UI. 0 to 100.

/me, /gme, and /ooc

/me and proximity /ooc reach only players in range and in the same routing bucket, based on positions when the message is sent. The server caps proximity range at 200 units. /gme and /ooc with Range = 0 are global across routing buckets.

KeyDefaultEffect
Config.Me.EnabledtrueRegisters /me.
Config.Me.Color{ 200, 140, 200 }3D text color, RGB 0 to 255.
Config.Me.Duration8000Milliseconds the 3D text stays above the player.
Config.Me.Range20.0Distance in game units that others can see it.
Config.Me.FontScale0.43D text size.
Config.Me.MaxActiveEntries20Most 3D entries shown at once on a client. Minimum 5.
Config.Me.MaxRenderPerTick12Most entries drawn per frame.
Config.Me.ShowInChatfalseAlso adds the action to the chat log for nearby players.
Config.Gme.EnabledtrueRegisters /gme.
Config.Gme.Color{ 227, 154, 192 }/gme line color.
Config.Ooc.EnabledtrueRegisters /ooc.
Config.Ooc.Color{ 143, 180, 224 }OOC line color.
Config.Ooc.Prefix'OOC'Label shown before OOC messages.
Config.Ooc.Range00 is global. Above 0 limits OOC to that many game units.

Dice rolls

/rolldice shows the result as 3D text above the roller, not in the chat log. The server picks the number. Range, Duration, and FontScale are optional; when left unset, the /me values are used.

KeyDefaultEffect
Config.RollDice.EnabledtrueRegisters /rolldice.
Config.RollDice.MaxValue9999Highest allowed roll. Capped at 9999.
Config.RollDice.Color{ 255, 215, 120 }3D text color.
Config.RollDice.RangeNot set (uses Config.Me.Range)Optional visibility range in game units.
Config.RollDice.DurationNot set (uses Config.Me.Duration)Optional display time in milliseconds.
Config.RollDice.FontScaleNot set (uses Config.Me.FontScale)Optional 3D text size.

/dv and debug

Permission providers, the block marker, and the custom export are set in server/permissions_config.lua. The default Mode is 'auto', with BlockAce = 'cortex.chat.blockDv' and AdditionalAces = { 'command.dv' }.

KeyDefaultEffect
Config.Dv.EnabledtrueRegisters /dv. Set false if another resource owns /dv.
Config.Dv.Ace'cortex.chat.dv'Direct ACE checked in auto and ace modes. A blank value grants nothing through this path.
Config.Dv.Range6.0Server-enforced deletion distance. 1.5 to 25.
Config.Dv.CooldownMs1500Server-enforced time between requests, separate from chat limits. 1000 to 60000.
Config.Debug.EnabledfalsePrints debug logging.

Upgrading an older config

Merge the Config.Dv.Ace and Config.Dv.CooldownMs fields into an older config.lua, and install both server permission files with the updated fxmanifest.lua. An old OpenKey value of 'INPUT_MP_TEXT_CHAT_ALL' is read as 'T'.

Auto mode can inherit broader grants from other systems. To keep a Chat-only /dv policy, pin Mode = 'ace' and empty AdditionalAces.