The resource has three config files, all unescrowed.
| File | Loaded by | What it holds |
|---|---|---|
config/main.lua |
Client and server | General switches, the ui block and the rarities table. |
config/crates.lua |
Server only | The crate definitions. Clients never download the loot tables. |
config/server.lua |
Server only | Throttle, payout timing, pending-loot retries, crate pack and integrations. |
config/crates.demo.lua is a second crate file for the demo pack. See Installation.
Configuration reference#
General (config/main.lua)#
| Option | Default | What it does |
|---|---|---|
config.debug |
false |
Prints every roll and payout to the server console. |
config.useUI |
true |
false opens crates instantly with a notification and no screen. |
config.locale |
'en' |
A file in locales/. |
UI (config.ui)#
| Option | Default | What it does |
|---|---|---|
showPreview |
true |
Shows the Unlock Container screen first. false goes straight to the reel. |
showChances |
true |
Shows drop odds on the preview. |
spinTime |
6.5 |
Seconds the reel spins before it settles. |
reelLength |
56 |
Cards on the reel. |
winnerIndex |
48 |
Card the reel lands on (1-based). Keep it between 12 and reelLength - 4, otherwise the server warns and uses reelLength - 8. |
allowSkip |
true |
SPACE or ESC skips to the reveal. |
volume |
0.5 |
Reel tick volume. 0 mutes it. The reveal uses GTA frontend sounds. |
blurBackground |
true |
Blurs the world behind the screen. |
inventory.iconPath |
false |
Image folder ending in /. false uses the ox_inventory image path. |
inventory.iconExtension |
'.png' |
Extension added to the item name. |
inventory.iconOverrides |
{} |
Per-item image urls, ['item_name'] = 'https://...'. |
inventory.fallbackIcon |
false |
Image url for items with no icon. false uses a built-in placeholder. |
Rarities (config.rarities)#
Each grade has:
- label: the name on the card.
- color: the grade colour.
- order: higher is rarer. Grades from 6 up get sparkles on the reveal.
- sound: a GTA frontend sound as
{ name, soundSet }, played on the reveal. - mystery: optional.
truehides the grade behind a gold star card until it is revealed.
The defaults are common, uncommon, rare, very-rare, epic, legendary and mythic, in the CS2 colours. Mythic is a mystery grade. A reward with an unknown rarity is treated as common and logged at start.
Server (config/server.lua)#
| Option | Default | What it does |
|---|---|---|
revealGrace |
25 |
Seconds past ui.spinTime before the server pays out a rolled crate anyway. |
throttle.use / throttle.again |
0.5 / 0.6 |
Seconds between crate requests per player, for using a crate and for Open Another. |
blockWhenIncapacitated |
true |
Dead, last stand and cuffed players cannot open crates (Qbox and QBCore metadata). |
pendingDelay |
5 |
Seconds to wait after a character loads before handing over saved loot. |
pendingTries |
10 |
How many times to retry that hand-over. |
cratePack |
'auto' |
'generic' loads config/crates.lua. 'demo' loads config/crates.demo.lua. 'auto' loads the demo pack when a resource named glitch-economy exists and the generic pack otherwise. |
If you want your own crates to always load, set cratePack = 'generic'. On a server with a resource called glitch-economy, 'auto' would pick the demo pack.
Integrations (config.integrations)#
| Option | Default | What it does |
|---|---|---|
pawnCheck |
false |
Set to { resource = 'glitch-criminaltablet', category = 'Trading cards' } to get a console warning, about 15 seconds after start, for every item in a crate of that category that the pawn counter would not buy. |
Crate fields (config/crates.lua)#
The key of each entry is the crate's inventory item name. It must exist in ox_inventory.
| Field | What it does |
|---|---|
rewards |
Exactly one is rolled. chance is a weight, so the numbers do not need to add up to 100 and decimals are fine. |
rewards[].item |
The inventory item to give. |
rewards[].min / max |
Amount range. |
rewards[].rarity |
A key of config.rarities. |
rewards[].label |
Optional. Falls back to the inventory item label. |
bonusItems |
Always given on top of the reward. amount is a number or { min, max }. |
name |
Title on the preview. Falls back to the crate item label. |
category |
Small label above the name. |
description |
One line under the name. |
accent |
Colour of the drawn case on the preview. |
image |
An image url to show instead of the drawn case. Defaults to the crate item's icon. |
rewards[].blueprint / unlock |
A glitch-crafting recipe or unlock id. The reward becomes a crafting blueprint item. Needs glitch-crafting. |
rewards[].sources |
{ jobId = true }. The reward only exists in crates whose item metadata source is one of those jobs. |
rewards[].weights |
{ jobId = 2.0 }. Multiplies the reward's chance for crates from that job. |
Stuck on a step?Ask in the Discord →