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.
Syntax
Section titled “Syntax”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) |
Returns
Section titled “Returns”boolean - false for an unknown item or shop
Example
Section titled “Example”SetShopItem(store, "bandage_classic", 12, 20)-- the stock comes back every ten minutesSetTimer(function() SetShopItem(store, "bandage_classic", 12, 20) end, 600000, true)See also
Section titled “See also”RemoveShopItem · GetShopItems · CreateShop · the Shops and vendors group of the index
