Scorpio Development

scorpio_bombs — Installation

Requirements

  • ox_lib
  • Framework: ESX Legacy, QBCore or Qbox
  • Inventory: ox_inventory or qb-inventory
  • Target: ox_target or qb-target

Framework, inventory and target are detected automatically. If detection fails, set Config.Framework, Config.Inventory and Config.Target in shared/config.lua.

ESX 1.14+ with ox_inventory: newer ESX recipes ship their own esx_inventory. Do not start it alongside ox_inventory — remove it from [core] or stop it in server.cfg.

1. Resource

  1. Put scorpio_bombs into your resources folder.
  2. Add it to server.cfg after your framework, inventory, target and ox_lib:
ensure scorpio_bombs

2. Items

Copy the images from install/images/ into your inventory:

Inventory Folder
ox_inventory ox_inventory/web/images/
qb-inventory qb-inventory/html/images/

ox_inventory (ox_inventory/data/items.lua)

['bomb'] = {
    label = 'Timed Bomb',
    weight = 3500,
    stack = false,
    consume = 0,
    description = 'An explosive charge with a timer. Set the timer when planting it.',
    client = { export = 'scorpio_bombs.useBomb' },
},
['bomb_defusal_kit'] = {
    label = 'Defusal Kit',
    weight = 1500,
    stack = false,
    description = 'Cutters, probes and a multimeter. Required to work on a bomb.',
},
['bomb_manual'] = {
    label = 'Defusal Manual',
    weight = 300,
    stack = false,
    consume = 0,
    description = 'Defusal rules for every bomb edition. The edition is printed on the back of the bomb.',
    client = { export = 'scorpio_bombs.useManual' },
},

consume = 0 is required. Without it ox_inventory removes the item on use, and the bomb is removed by the script only once it is actually planted.

qb-inventory (qb-core/shared/items.lua)

bomb             = { name = 'bomb', label = 'Timed Bomb', weight = 3500, type = 'item', image = 'bomb.png', unique = true, useable = true, shouldClose = true, description = 'An explosive charge with a timer. Set the timer when planting it.' },
bomb_defusal_kit = { name = 'bomb_defusal_kit', label = 'Defusal Kit', weight = 1500, type = 'item', image = 'bomb_defusal_kit.png', unique = true, useable = false, shouldClose = false, description = 'Cutters, probes and a multimeter. Required to work on a bomb.' },
bomb_manual      = { name = 'bomb_manual', label = 'Defusal Manual', weight = 300, type = 'item', image = 'bomb_manual.png', unique = true, useable = true, shouldClose = true, description = 'Defusal rules for every bomb edition. The edition is printed on the back of the bomb.' },

Restart the server (or the inventory and the framework) after adding the items.

3. Language

The script uses ox_lib locales. Set the language in server.cfg:

setr ox:locale "en"

Included: en, cs. To add a language, copy locales/en.json to locales/<code>.json and translate the values. Missing keys fall back to English.

The words used by the Radio and Password modules and the button labels follow the server language (ox:locale), so the bomb and the manual always match, even if a player picks a different language in the ox_lib settings.

4. Item metadata (optional)

A bomb item can carry metadata, e.g. from a crafting recipe or a shop:

Key Meaning
modules Number of modules (Config.Bomb.minModules–maxModules). Default: Config.Bomb.defaultModules.
edition Edition from Config.Editions. Missing or unknown = a random edition when planted.

ox_inventory example:

exports.ox_inventory:AddItem(source, 'bomb', 1, { modules = 3, edition = 'K-7' })

5. Integrations

custom/server.lua and custom/client.lua are open files for your own systems:

  • Dispatch — Custom.reportPlant, Custom.clearPlantReport, Custom.reportExplosion
  • Logs — Custom.log
  • Death / cuffs — Custom.isIncapacitated (server and client)

Every hook has a working default, so the script runs without touching them.

6. Testing

  1. Give yourself all three items.
  2. Use Timed Bomb, choose the timer and place the bomb.
  3. Use Defusal Manual (ideally a second player) and pick the edition printed on the back of the bomb.
  4. Look at the bomb with your target key and select Defuse bomb (requires the defusal kit).

Give items in-game:

Inventory Command
ox_inventory /giveitem <id> bomb 1
qb-inventory /giveitem <id> bomb 1