NX Dumpster Diving

Installation

Add the items and images to ox_inventory and start the resource.

Install

  1. Download the resource

    Download nx-dumpsterdiving from Granted Assets in the Cfx.re Portal and place the folder in your resources, for example resources/[nx]/nx-dumpsterdiving.

  2. Add the items to ox_inventory

    Open install/ox.lua and copy every item into ox_inventory/data/items.lua, inside the main return { } table:

    ox_inventory/data/items.lua
    return {
        -- ...your existing items
    
        ['trash_bag'] = {
            label = 'Bag of Trash',
            weight = 500,
            stack = true,
            close = true,
            description = 'A box full of random garbage. Someone might want it.',
        },
    
        -- ...paste the rest from install/ox.lua
    }
  3. Add the item images

    Copy every image from install/images/ into ox_inventory/web/images/. The file names already match the item names, so there's nothing to rename. The sell menu uses these same images.

  4. Ensure it after its dependencies

    It must start after ESX and the ox resources:

    server.cfg
    ensure es_extended
    ensure ox_lib
    ensure ox_target
    ensure ox_inventory
    # ...your other resources
    ensure nx-dumpsterdiving

    If it's inside a bracket folder like [nx], make sure ensure [nx] comes after ox_inventory.

  5. Configure it

    The defaults work out of the box. You'll probably want to check the buyer location, the prices and the notification system.

  6. Restart your server

    Do a full restart (ox_inventory only loads new items on start). Then walk up to any dumpster, use third eye and pick Search Dumpster.

Don't skip the items

If the items aren't in ox_inventory, players will always get "your pockets are full" instead of loot, because the items can't be added to their inventory.

Updating

  1. Back up your config.lua.
  2. Download the new version and replace the whole folder.
  3. Copy your config values back in, checking for any new options. If the update adds new items, add them from install/ox.lua too.
  4. Restart the server.