Cemetery scavenging activity for Qbox/QBCore/ESX using ox_lib, ox_target, and ox_inventory.
Players need the item configured in Config.RequiredItem (shovel by default). Successful digs use the digging NUI minigame, then roll loot from config.lua -> Config.Loot.
- One framework:
qbx_core(Qbox),qb-core(QBCore), ores_extended(ESX Legacy) ox_libox_targetox_inventory
- Put the folder in
resources/[w2f]/w2f-graverobberyand keep the resource name exactlyw2f-graverobbery. - Add the
items.luablock below toresources/[ox]/ox_inventory/data/items.luainside the mainreturn { ... }table. - Add inventory icons if you want item images (
install_assets/README.mdlists the file names). - Configure
webhook_config.luaif you want Discord loot logs. - Start resources in this order:
ensure ox_lib
ensure ox_target
ensure ox_inventory
ensure <your framework>
ensure w2f-graverobberyAfter editing inventory items or icons, restart:
restart ox_inventory
restart w2f-graverobberyPaste this block into data/items.lua inside the main return { ... } table.
Do not duplicate keys if your server already defines one of these items.
-- ======================================================================
-- W2F GRAVEROBBERY - Required tool
-- ======================================================================
['shovel'] = {
label = 'Grave Shovel',
weight = 3000,
stack = false,
close = false,
},
-- ======================================================================
-- W2F GRAVEROBBERY - Common loot
-- ======================================================================
['bone'] = {
label = 'Bone',
weight = 200,
stack = true,
close = true,
},
['dirt'] = {
label = 'Dirt',
weight = 800,
stack = true,
close = true,
},
['old_ring'] = {
label = 'Old Ring',
weight = 100,
stack = true,
close = true,
},
['silver_coin'] = {
label = 'Silver Coin',
weight = 50,
stack = true,
close = true,
},
-- ======================================================================
-- W2F GRAVEROBBERY - Gem loot
-- ======================================================================
['ruby'] = {
label = 'Ruby',
weight = 50,
stack = true,
close = true,
},
['emerald'] = {
label = 'Emerald',
weight = 50,
stack = true,
close = true,
},
['diamond'] = {
label = 'Diamond',
weight = 30,
stack = true,
close = true,
},
-- ======================================================================
-- W2F GRAVEROBBERY - Rare loot
-- ======================================================================
['old_weapon'] = {
label = 'Old Weapon',
weight = 4000,
stack = true,
close = true,
},
['gold_necklace'] = {
label = 'Gold Necklace',
weight = 300,
stack = true,
close = true,
},
['ancient_artifact'] = {
label = 'Ancient Artifact',
weight = 600,
stack = true,
close = true,
},
['cursed_skull'] = {
label = 'Cursed Skull',
weight = 1200,
stack = true,
close = true,
},
['treasure_map'] = {
label = 'Treasure Map',
weight = 100,
stack = true,
close = true,
},Required tool:
shovel
Common loot:
bone, dirt, old_ring, silver_coin
Gem loot:
ruby, emerald, diamond
Rare loot:
old_weapon, gold_necklace, ancient_artifact, cursed_skull, treasure_map
Inventory item PNGs are optional, but recommended.
Copy matching {item}.png files into:
resources/[ox]/ox_inventory/web/images/
Required image names are listed in install_assets/README.md.
The nui/digging/svg/ files are for the digging minigame UI and are separate from ox_inventory item images.
Open webhook_config.lua.
Leave this empty to disable Discord loot logging:
WebhookConfig.LootWebhook = ''Or set it to your Discord webhook URL:
WebhookConfig.LootWebhook = 'https://discord.com/api/webhooks/...'Optional display settings:
WebhookConfig.BotName = 'W2F Grave Robbery'
WebhookConfig.BotAvatar = ''
WebhookConfig.Colors = {
loot = 3066993,
}| File | Purpose |
|---|---|
config.lua |
Grave locations, required item, dig time, distance checks, loot table, loot amounts |
webhook_config.lua |
Discord webhook URL, bot name/avatar, embed colour |
locales/en.lua |
English locale strings |
locales/locale.lua |
Locale helper |
client/main.lua |
Grave target setup and digging/minigame client flow |
server/server.lua |
Loot rolls, inventory rewards, cooldown checks, webhook logging |
nui/digging/ |
Digging minigame UI |
install_assets/README.md |
ox_inventory icon file list |
Tune the main gameplay in config.lua:
Config.RequiredItem: required tool item, defaultshovel.Config.DiggingTime: dig progress time in milliseconds, default10000.Config.MaxDigDistance: maximum distance allowed during digging.Config.Graves: grave target coordinates, labels, icons, distances, and cooldowns.Config.Loot: loot items, labels, min/max amounts, and weighted chances.Config.MinLootItems/Config.MaxLootItems: number of loot rolls per successful dig.
Loot weights are relative. The default table totals 1000, so each weight point is roughly 0.1% chance per roll.
| Issue | Fix |
|---|---|
| Grave target does not appear | Make sure ox_target is started before w2f-graverobbery and grave coords are valid. |
| Player cannot dig | Make sure the player has Config.RequiredItem (shovel by default). |
| Loot is missing after success | Make sure every Config.Loot item exists in ox_inventory/data/items.lua. |
| Item icons are blank | Copy {item}.png files into ox_inventory/web/images/, then restart ox_inventory. |
| Discord logs do not send | Check WebhookConfig.LootWebhook; leave it empty if logging is not wanted. |
| NUI/minigame is blank | Confirm nui/digging/index.html and nui/digging/svg/*.svg are listed in fxmanifest.lua. |


