Inventory
Server
--import
local core = Framework.core or exports.bl_bridge:core()
local inventory = Framework.inventory or exports.bl_bridge:inventory()

Player Items interactions

local player = core.GetPlayer(source)
player.addItem(item, amount, metadata, slot)
player.removeItem(item, amount, slot)
player.getItem(item)
player.items -- get player items
  • source: number
  • item: string
  • amount: number
  • metadata: table
  • slot: number

RegisterUsableItem

core.RegisterUsableItem(item, cb)
  • item: string
  • cb: function(source, slotId, metadata)

registerInventory

inventory.registerInventory(id, {
   type = invType,
   name = name,
   items = items,
   maxWeight = maxWeight,
   slots = slots
})
  • id: string
  • invType: shop | stash
  • name?: string
  • items?: itemsData as ox (this will not work on stash type)
  • maxWeight?: number (this will not work on shop type)
  • slots?: number (this will not work on shop type)