All posts

How to run a shop, stock and bank for a Discord roleplay server (D&D, DayZ, GTA RP)

CordBase Team

For a D&D or roleplay server, keep one CordBase table for player inventories (one row per item, with the owner on it) and one for shop stock (one row per item, with a count). Players look things up with slash commands, and staff change counts with /shop update ... _mode:Decrement. It records stock; it doesn't run a shop.

Most servers start with a pinned message, a spreadsheet, or an economy bot. The pinned message breaks when two people edit it at once, the spreadsheet lives outside Discord, and economy bots are built around buying things with points. This guide sets up plain records inside Discord instead, using CordBase, which we build. The inventory and shop take about ten minutes.

What you'll end up with

  • An /inventory command (add, query, view, update, delete, leaderboard) holding what each character carries.
  • A /shop command holding what a trader has in stock and at what price.
  • Optionally a /bank command with deposits and loans per member, as plain numbers.
  • Role permissions so players can look things up and only staff can change counts.

Step 1: Set up the per-character inventory

The inventory part is the same setup as the guild bank guide: install the Inventory Tracker template (item, quantity, owner, rarity, notes), rename the slug to inventory, give players read and your GM or staff role write. Two things matter more in a roleplay server than in a guild bank.

First, commands like update and view make you pick a row from a list that shows only the table's first text column. If Mara and Joss both hold a Healing Potion you get two identical lines, so put the holder in the item name: Healing Potion (Mara). The owner column still filters by member.

Second, write permission covers every row, not just a player's own, so a player with write can edit anyone's inventory. Keep write for staff and give players read.

/inventory add item:Healing Potion (Mara) quantity:3 owner:@Mara rarity:Common

/inventory update row:Healing Potion (Mara) quantity:1 _mode:Decrement

/inventory query owner:@Mara lists everything Mara holds. Query shows the newest rows first (10 by default, up to 25 with limit) and only the first four columns, so keep the important ones at the front. Increment adds, Decrement subtracts, and Set (the default) replaces the value.

Step 2: Add a shop stock table

Free plans include two tables, so inventory plus shop fits. In the dashboard, create a table called Shop with these columns: item (text, required), stock (number, required), price (number), category (select, with your own choices such as Weapons, Ammo, Medical) and notes (text). Column types can't be changed after creation, so make counts and prices numbers.

  • /shop add item:Bandage stock:40 price:25 category:Medical
  • /shop update row:Bandage stock:1 _mode:Decrement records one sale. Staff run it when a sale happens in the roleplay.
  • /shop update row:Bandage stock:20 _mode:Increment records a restock.
  • /shop update row:Bandage price:30 changes the price.
  • /shop query stock:0 lists sold-out items (an exact match, not "less than").

_mode applies to every number you pass in one command. If you send stock and price together with Decrement, both go down. Change them in separate commands.

For a vehicle dealership, use the same shape with vehicle, stock, price and a dealer column (type user), then /shop query dealer:@Kade shows one dealer's lot.

Stock can go below zero. Nothing stops a decrement at 0, so check the count if you care.

Step 3: Bank and loans as plain records (optional)

Create a table called Bank with account (text, required, first so the row picker shows it), member (user), balance (number), loan_owed (number) and notes (text). Inventory and shop already use the two free tables, so this third one needs Pro.

  • /bank add account:Mara member:@Mara balance:500 loan_owed:0
  • /bank update row:Mara balance:200 _mode:Increment logs a deposit.
  • /bank update row:Mara loan_owed:100 _mode:Decrement logs a repayment.
  • /bank leaderboard column:loan_owed ranks the largest debts first.

There is no interest, due date or automatic transfer. Staff type the numbers. There is also no change history: view shows who created a row and when it last changed, not the old values. If you need a trail, add a Transactions table (account, amount, kind, date) and add a row for each movement. For a shared guild pool instead, see the guild bank guide.

When something else fits better

CordBase has no shop checkout, no currency that players earn or spend, and no payments between members. Commands are always the table name plus one of the fixed actions, so you can't make a custom /withdraw. It doesn't read messages, so "-100 arrows" typed in chat does nothing. If you want a virtual economy where members earn coins and buy from a store, use an economy bot such as UnbelievaBoat. If you want rules and dice, use a tabletop bot such as Avrae (see the character sheet guide). A spreadsheet is better if you need formulas.

Limits worth knowing

  • Free: 2 tables, 100 rows each. Pro ($8/month): unlimited tables, 10,000 rows per table, CSV/JSON export and bulk edits. Team ($15/month): 50,000 rows. See pricing.
  • Up to 25 columns per table. Tables are designed on the web, not from Discord.
  • Each member can run 5 commands per 10 seconds.
  • No CSV import today, so existing lists go in with add or through the dashboard.
  • See the commands reference for every option.

Questions people ask

Can I get a /withdraw command or let players buy items themselves?

No. Each table gets the fixed actions add, query, view, update, delete and leaderboard under its own name. The closest thing is /shop update row:... stock:1 _mode:Decrement, which anyone with write access can run. Nothing is charged to the player and no currency moves.

Can each player see or edit only their own inventory?

Not as a permission. Anyone with read access can query the whole table, and anyone with write access can change any row. Members can filter to their own items with /inventory query owner:@yourname.

Does this fit on the free plan?

The inventory and shop tables do, since Free allows 2 tables with 100 rows each. A third table, such as a bank, needs Pro at $8/month.