Comment on page
💰
ShopService
Service for adding and removing items from the shop.
Example usage:
Events.MatchStart(function(event)
-- Adds 1 Solar Panel to the shop that can be purchased for 3 Diamonds
ShopService.addItem(ItemType.SOLAR_PANEL, 1, ItemType.DIAMOND, 3)
-- Adds 1 Tennis Racket to the shop that can be purchased for 15 Iron
ShopService.addItem(ItemType.TENNIS_RACKET, 1, ItemType.IRON, 15)
end)
getAllShopkeeperIds(): string[]
Returns all current shopkeepers (by ID) in the game.
Creates an item shopkeeper or upgrade shopkeeper at the given position. Returns the ID (string) of the created shop.
despawnShopkeeper(shopId: string)
Deletes the shopkeeper with the given ID (string).
Adds an item to the shop for all players.
- amount - The amount of the item received when purchased
- costItem - The type of item needed to purchase the specified item
- price - The amount of the cost item needed to purchase the specified item
Removes the item from the shop for all players.
Last modified 3mo ago