InventoryItem
InventoryItem contains the data for an item retrieved through Inventory.GetItem or Inventory.GetItems. Provides information about item quantity, availability, timestamps, and reservations.
Properties
Total quantity of this item the owner has (includes reserved items).
print("Total items: " .. item.amount)
Quantity of this item that is not reserved and can be used in transactions.
print("Available items: " .. item.available)
local reservedCount = item.amount - item.available
Unix epoch timestamp (UTC) when the holder first obtained this item. Use os.date() to format into human-readable format.
local createdDate = os.date("%Y-%m-%d %H:%M:%S", item.createdAt)
print("Item created: " .. createdDate)
The ID of the holder (player) who owns this item.
print("Owner ID: " .. item.holderId)
The unique identifier of the item.
print("Item ID: " .. item.id)
Array of InventoryReservations showing how many items are reserved and their purposes.
for i, reservation in ipairs(item.reservations) do
print("Reserved: " .. reservation.amount .. " for " .. reservation.reservedFor)
end
Unix epoch timestamp (UTC) when this item was last modified. Use os.date() to format into human-readable format.
local updatedDate = os.date("%Y-%m-%d %H:%M:%S", item.updatedAt)
print("Item updated: " .. updatedDate)
Updated 19 days ago