Installation

How to install GiftBox. Start this after ox_lib, your framework, your inventory, and Newb_Bridge. The bridge looks at what’s already running. If this script starts first, it can miss them.

Start this after ox_lib, your framework, your inventory, and Newb_Bridge. The bridge looks at what’s already running. If this script starts first, it can miss them.

Dependencies

Newb_Bridge, ox_lib, and your framework plus inventory through the bridge. oxmysql is not required.

Add items and images

Register each key in Config.GiftBoxes as a usable item. The resource calls bridge.framework.registerItemUse for every entry at start. If you add holiday_box, you also add a holiday_box inventory item. Reward item names inside the box table must already exist in your inventory.

Paste from Item setup. Copy giftbox.png from [INSTALL]/ into:

InventoryImage folder
ox_inventoryox_inventory/web/images/
qb-inventory / ps-inventoryhtml/images/
one_inventoryone_inventory/web/images/

Configure

Edit configs/config.lua (server-only). always = true always grants. weight is a relative ox_lib selector weight (not 0-1). One weighted extra is rolled per open. account is optional (accountType of cash / bank / money, amount, plus always or weight).

Add to server.cfg

Swap qbx_core / ox_inventory for whatever you actually run.

ensure ox_lib
ensure qbx_core
ensure ox_inventory
ensure Newb_Bridge
ensure MrNewbGiftBox

Restart the server

Restart after config or item changes.

On this page