Skip to content

Market Module

The market module handles buying, selling, and checking stock for seeds and gear.


FunctionReturnsDescription
market.getSeedStockTime()numberSeconds until the next seed restock.
market.getSeedStock()listReturns the current available seeds.
market.getSeedPrice(seed)numberReturns the current seed price.
market.buySeed(seed)voidBuys one seed of the specified type.

FunctionReturnsDescription
market.getGearStockTime()numberSeconds until the next gear restock.
market.getGearStock()listReturns the current available gear.
market.getGearPrice(gear)numberReturns the current gear price.
market.buyGear(gear)voidBuys one gear item of the specified type.

FunctionReturnsDescription
market.whatValue(slot)numberReturns the value of the item in the given slot.
market.sellItem(slot)voidSells the item in the given slot.
market.sellAllItem()voidSells every sellable item in your inventory.

Triggered when seed stock changes.

market.changedSeedStock:connect(func()
player.sent("The seed market changed.")
end)

Triggered when gear stock changes.

market.changedGearStock:connect(func()
player.sent("The gear market changed.")
end)
lau-compiler.exe
varol seedType = Enum.Seed.Wheat
varol price = market.getSeedPrice(seedType)
print("Checking price for Wheat...")
if player.scrap() >= price then
market.buySeed(seedType)
print("Buying 1 unit.")
end
OUTPUT:
Checking price for Wheat... Buying 1 unit.