Stick's Resources

Exports

Server-side Lua exports provided by ItemsDB.

All exports are server-side only.

-- Fetch a single item by name
local item = exports.ItemsDB:getItem('water')

-- Fetch all items as a table keyed by name
local items = exports.ItemsDB:getItems()

-- Fetch a client-safe view of all items (no server fields, no functions)
local clientItems = exports.ItemsDB:getClientItems()

-- Add or update an item
exports.ItemsDB:upsertItem({ name = 'testitem', label = 'Test Item', weight = 100 })

-- Remove an item
exports.ItemsDB:deleteItem('testitem')

-- Check if ItemsDB has finished loading
local ready = exports.ItemsDB:isReady()

Notes

  • getItem and getItems wait for ItemsDB to be ready before returning.
  • upsertItem and deleteItem automatically sync changes to ox_inventory's live ItemList and broadcast to all connected clients. See Client Sync for details.

On this page