Studios
Exchangehouse-3.jpg

Examples

SoonExchangeQbox
PAGE 04 OF 06  ·  CONFIGURATION → EXAMPLES → TROUBLESHOOTINGdocs.glitchstudios.dev
Browse docs

Pay the sell fee into a treasury#

Config.Treasury = 'glitch-treasury'

The treasury resource needs an export Collect(amount, reason, citizenid, item). The exchange calls it with the reason exchange_fee after each sale.

Let another resource set the fee#

Config.FeeLever = { state = 'my-economy:levers', key = 'exchange_fee' }
-- in your own resource, server side
GlobalState['my-economy:levers'] = { exchange_fee = 8 }   -- 8 percent

Replace the whole table to change a value, because GlobalState only replicates when the table is assigned.

Add a tradeable material#

  1. Make sure the item exists in ox_inventory/data/items.lua and has an image.

  2. Add it with its reference price:

    Config.Items.gold_bar = 800
    
  3. Restart glitch-exchange. The allowed price band follows the reference price, so this one accepts $400 to $2400 with the default band.

Tighten the market#

Config.PriceMin = 0.8
Config.PriceMax = 1.5
Config.MaxListings = 5
Config.OrderHours = { 6, 24, 72 }
Config.OrderDefaultHours = 24

Move the desk#

Config.Desk.coords = vec4(-269.4, -955.4, 31.2, 205.0)
Config.Desk.place  = 'Legion desk'
Config.Desk.postal = '300'

Messages then read "Collect it at the Legion desk".

Check a new install#

  1. Give a character some iron, go to the desk and list a few units.
  2. On a second character, open the desk (or the phone app after a first desk visit) and buy them. The first character is paid to the bank minus the fee.
  3. Post a buy order, then cancel it or let it expire, and confirm the held money returns to the bank.