Parameters
Return value
Notes
options fields:
maxWeight(number, optional): Maximum weight capacitymaxSlots(number, optional): Maximum number of slotscolumns(number, optional): Number of columns for grid display in the UI (e.g. 10 total slots but 2 columns → 2x5 grid)temporary(boolean, optional): If true, the inventory is not saved to the database and will be lost on script restartprefillItems(table, optional): Random loot configuration. Items are picked via weighted selection without replacement:minTypes(number, optional): Minimum number of different item types to add. Default: 1maxTypes(number, optional): Maximum number of different item types to add. Default: pool sizeitems(table, required): Array of possible items, each entry:{name = string, chance = number, min = number, max = number, metadata = table?}
revealItems(table, optional): Progressive item reveal animation when the inventory is opened:delayPerItem(number, optional): Milliseconds between each item reveal. Default: 1000randomOrder(boolean, optional): If true, items are revealed in random order instead of slot order. Default: false
slots(table, optional): Per-slot configuration. Key is the slot number, value is aSlotConfigtable:label,image,opacity,whitelist,blacklistwhitelist/blacklist(table, optional): Inventory-level item filters. Format:{itemName = true, ...}allowedJobs(table, optional): Jobs allowed to access this inventoryallowedIdentifiers(table, optional): Character identifiers allowed to access this inventorydisableIncoming/disableOutgoing(boolean, optional): Block transfers in or out by the playerdropDisabled(boolean, optional): If true, items cannot be dropped from this inventorynoLimitDrag(boolean, optional): If true, dragging ignores the amount selection dialog and moves the full stack. Used internally for shops
- If
idalready exists, the existing inventory is returned as is, staticitemsandprefillItemsare NOT re-applied prefillItemsuses weighted random selection without replacement (each item type can only be picked once)prefillItemsis processed viaoptions, while staticitemsis a separate parameter, they serve different purposes- Use
temporary = truefor ephemeral inventories (lootboxes, event rewards) to avoid database bloat
