Studios
Loot Boxhouse-3.jpg

Commands & Exports

FreeLoot BoxQBCore · Qbox · ESX
PAGE 06 OF 07  ·  TROUBLESHOOTING → COMMANDS & EXPORTS → ADDING CRATESdocs.glitchstudios.dev
Browse docs

Commands#

None. Crates are opened by using the crate item. On the crate screen, SPACE or ENTER unlocks on the preview and opens another on the reveal, ESC or BACKSPACE closes, and SPACE, ENTER or ESC skips the reel.

Client exports#

None.

Server exports#

Export signature Returns
exports['glitch-lootBox']:GetDropRates() A table of item name to best pull chance in percent. An item in several crates reports its best chance.
exports['glitch-lootBox']:GetMysteryItems() A list of item names that sit behind a mystery grade in any crate.

glitch-cardAlbums reads both to show pack odds.

Events and callbacks#

There are no callbacks and no events meant for other resources. The glitch-lootBox:server:* and glitch-lootBox:client:* events are the resource's internal session protocol. To start a crate, give the player the crate item and let them use it.

Integration notes#

  • Crates are registered as usable items through qbx_core, then qb-core, then es_extended, with glitch-abstraction as the last fallback.
  • A heist or job script can hand out crates with item metadata source = '<jobId>'. See Adding Crates.