Installation
Requirements
| Component | Required? |
|---|---|
ox_lib | Yes — callbacks, dialogs, and shared utilities |
oxmysql and a configured MySQL connection | Yes — persistent machine data |
ESX (es_extended), QBCore (qb-core), or Qbox (qbx_core) | One supported framework |
| A supported inventory | ox_inventory, qb-inventory, ps-inventory, qs-inventory, codem-inventory, origen_inventory, or a completed custom adapter |
ox_target or qb-target | Optional — TextUI is available instead |
lb-phone | Optional for the core machine; required for the included VendTrack app |
The bridge is included in this resource. Do not add lumix_bridge just to install vending.
Install the resource
Place the downloaded folder at a location such as:
resources/[nuiro]/nuiro-vending/Keep config.lua, bridge/, client/, server/, shared/, sql/, stream/, phone/, and web/build/ in the resource. The manifest loads the compiled interface from web/build/index.html; installing a release with that build does not require Node.js on the game server.
Register the machine item
The item name must match Config.item, which defaults to vending_machine. Register it in your inventory before starting vending.
ox_inventory
Add an entry to the table in ox_inventory/data/items.lua:
['vending_machine'] = {
label = 'Vending Machine',
weight = 8000,
stack = true,
close = true,
consume = 0,
client = {
export = 'nuiro-vending.useMachine',
},
},consume = 0 is intentional. The server removes one item only after a successful setup. Do not add a second consume action in another usable-item script.
Other supported inventories
Create the same vending_machine item using your inventory's item format. For a QB-style shared item table, an entry can look like:
vending_machine = {
name = 'vending_machine',
label = 'Vending Machine',
weight = 8000,
type = 'item',
image = 'vending_machine.png',
unique = false,
useable = true,
shouldClose = true,
description = 'A player-owned vending machine.',
},With a non-ox inventory, the resource registers the usable item through ESX, QBCore, or Qbox. Follow your inventory's normal item-loading procedure and supply an item image if its definition references one. A custom inventory also needs its adapter completed; see Integrations.
Set the start order
Example for ESX with ox_inventory and ox_target:
ensure oxmysql
ensure ox_lib
ensure es_extended
ensure ox_inventory
ensure ox_target
# Optional, when using VendTrack:
ensure lb-phone
ensure nuiro-vendingUse qb-core or qbx_core instead of es_extended for your framework. Replace the inventory and target lines to match your server, keeping their own dependencies in the order required by those resources. If using TextUI, omit the target resource and set Config.bridge.target = 'textui'.
Auto-detection reads resources that are already started. Review the startup message:
[nuiro-vending] framework esx | inventory ox | notify ox_lib | target ox_targetIf it selects the wrong integration, set the explicit IDs in Configuration.
Database setup
On startup, server/db.lua reads sql/install.sql, creates the eight nuiro_vending_* tables if needed, and loads saved machines. The database account needs permission to create those tables. The startup schema check can also add the design column to an older machines table.
Look for:
[nuiro-vending] SQL ready (8 statements from sql/install.sql).If automatic creation fails, check the MySQL connection and permissions. The included SQL file can be imported into the server's configured database by its administrator. Keep existing tables and data when updating the resource.
Decide whether to use rent
Servers without LB Phone
Rent is enabled by default, and the included bill-payment UI is in VendTrack. If you are not providing LB Phone and VendTrack, set Config.rent.enabled = false before opening machines to players. Otherwise, an unpaid bill can close a machine after its grace period.
Review the supplied rent amounts for your own economy; the default fallback price is 5,000,000 per seven-day period. VendTrack & Rent explains area prices and bill timing.
First-run check
- Join with a loaded character and confirm the startup log shows the intended framework and inventory.
- Visit the Vending Supplier configured at
46.52, -1749.55, 29.63, or obtain the registered item through your own shop. - Buy the machine item. With ox_inventory, the supplier uses an inventory shop and cash; the supplied
dealer.account = 'bank'applies to the non-ox purchase flow. - Use the item, choose a style, and complete the in-game setup. The supplied limit is two machines per owner.
- Open Service Machine, load an allowed item, set its price, and save.
- Purchase with a second character. Own-machine purchases are disabled by default.
- Check Sales and Cash Box; if using VendTrack, also verify its machine list and rent bill.
Continue with Player & Owner UI or Configuration.
