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:
- In Discord, type
/fivem setup. - Press Add a server and paste your
cfx.re/join/…link orIP:port. More about this step.
Step 4: Get your key
- In Discord, type
/fivem keyand press Enter. If you have more than one server, pick it in the server option. - 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, notsetrorsets(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:
- Whitelist: see Whitelist and department applications.
- Job roles: see Job to Discord roles.
- txAdmin logs: see txAdmin logs in Discord.
- Duty: in
/duty setup(not/fivem setup). See Duty and shifts.
Until you turn them on in Discord, nothing changes for your players.
Step 8: Test it
In the server console, type:
| Type this | What you should see |
|---|---|
glitchworks_link | "linked to …", and what's on |
glitchworks_link test 123456789012345678 | ALLOWED or NOT ALLOWED and why (use a real Discord user ID) |
glitchworks_link hello | It checks in again and lists what's on in Discord |
glitchworks_link duty | Who 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:
| Setting | What it does | Default |
|---|---|---|
Whitelist.Enabled | Check Discord roles when people connect | true |
Whitelist.FailOpen | If Glitchworks can't be reached: false keeps people out with "try again in a minute"; true lets everyone in | false |
Whitelist.Bypass | Your staff's identifiers: always let in, never checked | empty |
Whitelist.Messages | What players see | friendly defaults |
Whitelist.CacheSeconds | How long a "yes" is remembered (instant reconnects) | 60 |
JobSync.Enabled | Send job changes to Discord | true |
JobSync.Framework | auto works for QBCore, Qbox and ESX | auto |
TxAdmin.Enabled | Send txAdmin events to Discord | true |
TxAdmin.Events | Turn single events off (for example playerKicked = false) | all on |
Duty.Enabled | Send on and off duty to Discord (v1.1.0) | true |
Duty.Framework | auto works for QBCore, Qbox and ESX versions with a duty setting. none means your duty script uses the export (see below) | auto |
Duty.CheckSeconds | How often it also checks everyone's duty, in case it missed a change | 60 |
Duty.SnapshotMinutes | How often it sends a full "who's on duty" list, so a crash never leaves shifts open | 10 |
Duty.IgnoreJobs | Jobs never sent | { 'unemployed' } |
Config.Debug | Extra console lines while you set up | false |
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)
- Download the new Glitchworks Link (1.1.0).
- Replace
server.lua,fxmanifest.luaandREADME.mdin yourglitchworks_linkfolder. config.lua: either use the new one (then copy your own settings, like the bypass list, back into it), or keep yours and add theConfig.Duty = { … }block from the new one, just aboveConfig.Debug. Your key stays in server.cfg: nothing to change there.- Type
restart glitchworks_linkin the console. It should sayv1.1.0 starting · … · duty on (qbcore). - In Discord:
/duty setup> add a department > type its in-game job names (for examplepolice) > 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
| You see | What it means | What to do |
|---|---|---|
No key. In Discord run /fivem key… | server.cfg has no key line | Do step 5. The set line must be above ensure glitchworks_link. |
The key in server.cfg doesn't look right | Typo, missing quotes, or extra spaces | Copy the key again. It starts with gwl_. |
Glitchworks refused the key | The key was replaced or revoked | Run /fivem key, update server.cfg, then restart glitchworks_link. |
Glitchworks didn't answer | Your server can't reach https://api.glitchworks.uk | Ask your host to allow outgoing HTTPS (port 443). It keeps retrying by itself. |
The whitelist is on here but off in Discord | Normal until you set it up | Turn it on in /fivem setup > Whitelist. Until then, everyone can join. |
| Nothing at all in the console | The resource didn't start | Check the folder name is glitchworks_link and ensure glitchworks_link is in server.cfg. |
Not started. Fix the above… | A setting is wrong | Read the red line above it, fix it, then restart glitchworks_link. |
| Players: "We couldn't see your Discord account" | FiveM can't see their Discord | They must open the Discord desktop app, log in, then start FiveM. |
Duty is on here but off in Discord | Normal until you set it up | /duty setup: add a department with its in-game job names, then Turn on. |
config.lua has no Duty section | You kept your 1.0.0 config.lua | Add the Config.Duty block (see Updating to v1.1.0). |
Your ESX has no duty flag | Your ESX version doesn't track on/off duty | Use 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.
More help: FiveM server status · Whitelist and applications · Install MLOs and scripts · Help centre