Koja Scripts

Installation

Install Koja Chat: requirements, replacing the default chat resource, server.cfg order, staff and developer ACEs and building the UI.

Installation

Requirements

ResourceNotes
koja-libRequired. Names, jobs, money, admin groups and Discord logging go through it
ESX, QBCore, QBX or a custom frameworkSupported through koja-lib
OneSyncRecommended. Proximity is calculated on the server. Without it the clients filter by distance

No database is needed.

  1. Add the resource

    Put koja-chat in your resources folder. Keep the folder name.
  2. Remove the default chat

    Remove or stop the default chat resource. ensure chat is usually started by [system]. Koja Chat declares provide 'chat', so scripts that use exports.chat or the chat: events keep working without the original.
  3. Start it after koja-lib

    server.cfg
    ensure koja-lib
    ensure koja-chat
  4. Configure it

    Edit editable/config.lua. Change names, badges and the admin check in editable/server.lua, and the open check in editable/client.lua. See Configuration.

Developer console (optional)

The Console tab is off by default. To use it, enable Config.DevMode.enabled and give the group the ACE:

server.cfg
add_ace group.admin koja-chat.dev allow

Running server commands from the tab needs the separate Config.DevMode.execute = true. Only enable it for people you trust with the server console.

Discord logs (optional)

Set Config.Logs.enabled = true and a webhook in Config.Logs.webhook. See Configuration.

Building the UI (only if you change it)

The release ZIP ships the built UI in web/build. A source download of the repository does not, so build it first.

web
cd web
npm ci
npm run build   # outputs web/build
npm run dev     # browser preview with sample messages

Check that it works

  • Press T (the default Config.OpenKey). Players can rebind it in the GTA key settings under FiveM.
  • Type /me waves. The text appears for players within range and above your head.
  • Open the chat settings in the chat to change style, colour and position.