Glitchworks

Home / Help centre

FiveM

Install Glitchworks Link

A small, free, server-only FiveM resource that links your server to Glitchworks Guard: whitelist by Discord role, job roles, txAdmin logs and duty.

What it does

Glitchworks Link (glitchworks_link) is a small, free resource that connects your FiveM server to Glitchworks Guard in your Discord. It adds:

  • Whitelist by Discord role: only people with your Whitelisted role can join. Set it up.
  • Job to Discord roles: police in game means the LSPD role in Discord. Set it up.
  • txAdmin logs: bans, kicks, warnings and restart warnings in Discord. Set it up.
  • Duty to Discord New in 1.1.0: going on or off duty in game clocks people in and out in Discord. Set it up.

It runs on the server only. Players don't download anything, and it's designed to stay light on your server.

You'll need

  • Glitchworks Guard in your Discord, and the Manage Server permission there.
  • Access to your FiveM server's files (FTP, your host's file manager, or txAdmin) and its server.cfg.
  • About 5 minutes.

Step 1: Download it

Download Glitchworks Link v1.1.0 (zip, 17 KB)

Unzip it. You'll have a folder called glitchworks_link with four files inside: fxmanifest.lua, config.lua, server.lua and README.md. The latest version is 1.1.0. It's also posted in #discord-bots in the Glitchworks Discord.

Keep the folder name exactly glitchworks_link. Updating from 1.0.0? See Updating to v1.1.0.

Step 2: Put it in your resources

Copy the glitchworks_link folder into your server's resources folder. You can put it in a subfolder like resources/[glitchworks]/ if you like.

Step 3: Add your server in Discord

If you haven't already:

  1. In Discord, type /fivem setup.
  2. Press Add a server and paste your cfx.re/join/… link or IP:port. More about this step.

Step 4: Get your key

  1. In Discord, type /fivem key and press Enter. If you have more than one server, pick it in the server option.
  2. Guard shows your key once, only to you. It looks like gwl_1a2b3c4d5e6f_…. Copy it now.

Treat it like a password. Anyone with it could pretend to be your server. Never post it in Discord or put it in config.lua. Lost it, or a developer left? Run /fivem key again: the old key stops working straight away.

Step 5: Add two lines to server.cfg

Open server.cfg and add these two lines below your framework (below ensure qb-core, ensure qbx_core or ensure es_extended), pasting your own key:

set glitchworks_link_key "gwl_1a2b3c4d5e6f_paste-the-rest-of-your-key-here"
ensure glitchworks_link
  • Use set, not setr or sets (those would share the key with players).
  • Keep the quotes.

Save the file.

Step 6: Restart and check

Restart your server (txAdmin > Restart). In the server console (txAdmin > Live Console) you should see:

[glitchworks_link] v1.1.0 starting · whitelist on · job sync on (qbcore) · txAdmin on · duty on (qbcore)
[glitchworks_link] Linked to Your Discord as "Main server". In Discord: whitelist off, job roles off, txAdmin logs off, duty off.

"Linked to …" means it worked. In Discord, /fivem setup > The resource now says "resource seen a few seconds ago".

Step 7: Turn on what you want

Everything is switched on in Discord, in /fivem setup:

Until you turn them on in Discord, nothing changes for your players.

Step 8: Test it

In the server console, type:

Console test commands
Type thisWhat you should see
glitchworks_link"linked to …", and what's on
glitchworks_link test 123456789012345678ALLOWED or NOT ALLOWED and why (use a real Discord user ID)
glitchworks_link helloIt checks in again and lists what's on in Discord
glitchworks_link dutyWho it sees on duty right now (v1.1.0)

Your Discord user ID: in Discord, open User Settings > Advanced and turn on Developer Mode, then right-click your name and choose Copy User ID.

config.lua (optional)

You don't have to change anything. If you want to, open config.lua in the glitchworks_link folder:

config.lua settings
SettingWhat it doesDefault
Whitelist.EnabledCheck Discord roles when people connecttrue
Whitelist.FailOpenIf Glitchworks can't be reached: false keeps people out with "try again in a minute"; true lets everyone infalse
Whitelist.BypassYour staff's identifiers: always let in, never checkedempty
Whitelist.MessagesWhat players seefriendly defaults
Whitelist.CacheSecondsHow long a "yes" is remembered (instant reconnects)60
JobSync.EnabledSend job changes to Discordtrue
JobSync.Frameworkauto works for QBCore, Qbox and ESXauto
TxAdmin.EnabledSend txAdmin events to Discordtrue
TxAdmin.EventsTurn single events off (for example playerKicked = false)all on
Duty.EnabledSend on and off duty to Discord (v1.1.0)true
Duty.Frameworkauto works for QBCore, Qbox and ESX versions with a duty setting. none means your duty script uses the export (see below)auto
Duty.CheckSecondsHow often it also checks everyone's duty, in case it missed a change60
Duty.SnapshotMinutesHow often it sends a full "who's on duty" list, so a crash never leaves shifts open10
Duty.IgnoreJobsJobs never sent{ 'unemployed' }
Config.DebugExtra console lines while you set upfalse

After changing it, type restart glitchworks_link in the console.

Add your staff to the bypass list, so you can never lock yourself out:

Bypass = {
    'discord:123456789012345678',
},

Updating to v1.1.0 (duty)

  1. Download the new Glitchworks Link (1.1.0).
  2. Replace server.lua, fxmanifest.lua and README.md in your glitchworks_link folder.
  3. config.lua: either use the new one (then copy your own settings, like the bypass list, back into it), or keep yours and add the Config.Duty = { … } block from the new one, just above Config.Debug. Your key stays in server.cfg: nothing to change there.
  4. Type restart glitchworks_link in the console. It should say v1.1.0 starting · … · duty on (qbcore).
  5. In Discord: /duty setup > add a department > type its in-game job names (for example police) > Turn on. See Duty and shifts.

Keeping your old config.lua without the duty block is fine: everything else works, and the console says config.lua has no Duty section so you know duty is off.

Your own duty script? If your server uses a separate duty script rather than the framework's, ask your developer to add one line where it puts someone on or off duty:

exports.glitchworks_link:SetDuty(playerId, true)   -- on duty
exports.glitchworks_link:SetDuty(playerId, false)  -- off duty

and set Config.Duty.Framework = 'none'.

Troubleshooting

Glitchworks Link console messages and fixes
You seeWhat it meansWhat to do
No key. In Discord run /fivem key…server.cfg has no key lineDo step 5. The set line must be above ensure glitchworks_link.
The key in server.cfg doesn't look rightTypo, missing quotes, or extra spacesCopy the key again. It starts with gwl_.
Glitchworks refused the keyThe key was replaced or revokedRun /fivem key, update server.cfg, then restart glitchworks_link.
Glitchworks didn't answerYour server can't reach https://api.glitchworks.ukAsk your host to allow outgoing HTTPS (port 443). It keeps retrying by itself.
The whitelist is on here but off in DiscordNormal until you set it upTurn it on in /fivem setup > Whitelist. Until then, everyone can join.
Nothing at all in the consoleThe resource didn't startCheck the folder name is glitchworks_link and ensure glitchworks_link is in server.cfg.
Not started. Fix the above…A setting is wrongRead the red line above it, fix it, then restart glitchworks_link.
Players: "We couldn't see your Discord account"FiveM can't see their DiscordThey must open the Discord desktop app, log in, then start FiveM.
Duty is on here but off in DiscordNormal until you set it up/duty setup: add a department with its in-game job names, then Turn on.
config.lua has no Duty sectionYou kept your 1.0.0 config.luaAdd the Config.Duty block (see Updating to v1.1.0).
Your ESX has no duty flagYour ESX version doesn't track on/off dutyUse the SetDuty line in your duty script (see Updating to v1.1.0).

Still stuck?

Open a ticket on our Discord and tell us what you've tried. Screenshots of any errors help us sort it faster.

Open a ticket on Discord

More help: FiveM server status · Whitelist and applications · Install MLOs and scripts · Help centre