Market Module
The market module handles buying, selling, and checking stock for seeds and gear.
Seed Market
Section titled “Seed Market”| Function | Returns | Description |
|---|---|---|
market.getSeedStockTime() | number | Seconds until the next seed restock. |
market.getSeedStock() | list | Returns the current available seeds. |
market.getSeedPrice(seed) | number | Returns the current seed price. |
market.buySeed(seed) | void | Buys one seed of the specified type. |
Gear Market
Section titled “Gear Market”| Function | Returns | Description |
|---|---|---|
market.getGearStockTime() | number | Seconds until the next gear restock. |
market.getGearStock() | list | Returns the current available gear. |
market.getGearPrice(gear) | number | Returns the current gear price. |
market.buyGear(gear) | void | Buys one gear item of the specified type. |
Selling
Section titled “Selling”| Function | Returns | Description |
|---|---|---|
market.whatValue(slot) | number | Returns the value of the item in the given slot. |
market.sellItem(slot) | void | Sells the item in the given slot. |
market.sellAllItem() | void | Sells every sellable item in your inventory. |
Events
Section titled “Events”market.changedSeedStock
Section titled “market.changedSeedStock”Triggered when seed stock changes.
market.changedSeedStock:connect(func() player.sent("The seed market changed.")end)market.changedGearStock
Section titled “market.changedGearStock”Triggered when gear stock changes.
market.changedGearStock:connect(func() player.sent("The gear market changed.")end) lau-compiler.exe
varol seedType = Enum.Seed.Wheatvarol price = market.getSeedPrice(seedType)
print("Checking price for Wheat...")
if player.scrap() >= price then market.buySeed(seedType) print("Buying 1 unit.")endOUTPUT:
Checking price for Wheat...
Buying 1 unit.