Skip to content

SetShopItem

Puts an item on the shelf - or changes its price and stock.

item is any key of the item catalogue (the name, the id, the English name, the GUID); an unknown key returns false and logs. price is Groschen a piece. amount is the stock: nil or -1 = unlimited, 0 takes the row off the shelf. A row already there is changed in place; whoever has the screen open sees it move.

SetShopItem(shop, item, price [, amount])
Parameter Type
shop number the shop
item string | number the item’s name, id, English name or GUID
price number Groschen a piece
amount number the stock; nil / -1 = unlimited, 0 = off the shelf (optional)

boolean - false for an unknown item or shop

SetShopItem(store, "bandage_classic", 12, 20)
-- the stock comes back every ten minutes
SetTimer(function() SetShopItem(store, "bandage_classic", 12, 20) end, 600000, true)

RemoveShopItem · GetShopItems · CreateShop · the Shops and vendors group of the index