Overview
Britannia Crafting Tables puts crafting benches around your map. Walk up to one, press G, and a black and gold interface opens: a grid of everything that table makes, the chosen recipe with what it needs, and your crafting queue. Queue several things, walk away, and come back to collect them when they're done.
- Any number of tables, each at its own spot with its own recipes.
- A table can spawn a prop (a work table, a forge...) or use one already in your map.
- An item grid with category tabs and search; items above your level show the level they need.
- A crafting queue for each player at each table: crafts run one after another, even while the player is away or offline.
- Cancel anything not finished and get its ingredients and cash back.
- Lock tables to jobs, an owner or a private list, and give access in game by name or character id.
- Crafting levels per table (or shared), on XP ladders you set.
- English, Spanish and French.
The Lua is encrypted by Cfx.re; the settings, recipes, text and server settings stay editable.
Requirements
- poggy_core (free), version 0.11.0 or newer. Adding offline players to a table's access list by character id uses poggy_core 0.25.0 or newer to look up their name.
- oxmysql.
- One of VORP, RSG Core or QBCore RedM (poggy_core connects the script to it).
Install
- Download
Britannia_CraftingTablesfrom your Cfx.re account (portal.cfx.re → Assets → Granted Assets). - Put the
Britannia_CraftingTablesfolder in your server'sresourcesfolder. Don't rename it. - Add
ensure Britannia_CraftingTablestoserver.cfg, afterensure oxmysqlandensure poggy_core. - Place your tables in
shared/config.luaand set their recipes inshared/recipes.lua. - Restart the server. Its database tables are created automatically.
Items
The script adds no items of its own. Recipes use the items already on your server: set them in shared/recipes.lua.
Configuration
Settings are in shared/config.lua, and every option is commented. Recipes are in shared/recipes.lua; text is in locales/.
| Setting | What it does | Default |
|---|---|---|
Config.Locale | Language file to use: en, es or fr | 'en' |
Config.Debug | Prints extra lines in the server and F8 consoles | false |
Config.Key | The key that opens a table (e.g. 'G' or 'E') | 'G' |
Config.OpenDistance | How close (metres) a player must stand | 2.0 |
Config.PropDistance | How close a player must be for a table's prop to spawn | 80.0 |
Config.Scenario | An animation while the table is open, or false | false |
Config.Crafting.MaxBatch | The most of one recipe in one queue slot | 20 |
Config.Crafting.QueueSize | How many slots a player's queue at one table holds | 5 |
Config.ImageBase | Where item pictures come from. false asks poggy_core (works on VORP, RSG Core and QBCore RedM); another inventory sets its picture folder | false |
Config.AdminAces, Config.AdminGroups | Who counts as staff (can use and manage every table) | britannia_craftingtables.admin; admin, superadmin, god |
Config.Ladders | XP ladders: the XP each level takes | default, 10 levels |
Config.Tables | Your tables (see below) | two examples |
server/sv_config.lua holds a Discord webhook for a log of collected crafts and access changes (SvConfig.Webhook).
Tables
{
id = 'strawberry_worktable', -- never change it later (queues are saved under it)
label = 'Craftsman\'s Table',
coords = vector4(-1845.42, -442.04, 159.44, 138.90),
prop = 'p_tablework02x', -- a prop to spawn here, or false for a table already in the map
recipes = 'blacksmith', -- the list in shared/recipes.lua
ladder = 'default',
xpKey = 'blacksmith', -- tables sharing an xpKey share a level
jobs = { blacksmith = 0 }, -- who may use it; false = everyone
manageGrade = 3, -- job members at this grade or above can give access
owner = '12', -- optional: a character id who owns it and can give access
private = false, -- true = only the owner and players given access
blip = { sprite = -1138864184, name = 'Workbench' }, -- or false
}A table with jobs, an owner or private = true is locked. Otherwise everyone can use it.
Recipes
{
item = 'pickaxe_head', amount = 1, category = 'Tool parts',
desc = 'A forged head, ready for a handle.',
level = 0, xp = 12, time = 60, -- level needed, XP per item, seconds per craft
price = 0, -- optional cash cost per item
jobs = { blacksmith = 1 }, -- optional: who may craft it
ingredients = {
{ item = 'ironbar', amount = 3 },
{ item = 'hammer', amount = 1, keep = true }, -- a tool: needed, not used up
},
extras = { { item = 'nails', amount = 2 } }, -- optional bonus items
weapon = false, -- true when item is a WEAPON_...
}Commands and permissions
There are no commands: players open a table with the key. Staff are anyone with an ace in Config.AdminAces, anyone in Config.AdminGroups, and poggy_core admins. For example: add_ace group.admin britannia_craftingtables.admin allow.
How it works
Queueing. Pick an item, choose how many, and press Add to queue. The server checks the table's lock, the player's level and job, their cash and ingredients, then takes the ingredients (tools are only checked) and the cash. The craft is timed after anything already in that player's queue at that table.
Waiting. Crafts run in real time, one after another, whether the player is nearby, elsewhere or offline. An online player gets a message when something is ready.
Collecting. At the table, Collect gives every finished craft, any bonus items and the XP. If something won't fit in the player's inventory it stays in the queue until they make room.
Cancelling. ✕ on an unfinished craft gives back its ingredients and cash, and the crafts behind it move up.
Each player sees only their own queue. Nobody can collect or cancel someone else's crafts.
Access. On a locked table, the owner, job members at or above manageGrade and staff see an Access button: the players given access (✕ to remove), online players to add, and a box for a character id. Players are told when they're given access or lose it.
Troubleshooting
Nothing happens at a table
Stand closer (Config.OpenDistance). If it says the table is locked, the player needs the job, ownership or access.
An ingredient shows 0 although the player has it
The recipe's item name must match your items exactly (for example ironbar, not iron_bar). Close the table and open it again after picking items up.
The prop doesn't appear
Check the model name in prop. The server console prints a line for a model that isn't valid.
Item pictures show a gold star
The picture wasn't found. If your inventory isn't VORP, RSG Core or QBCore RedM, set Config.ImageBase to its picture folder.
Version history
- 1.0.0: first release.
Still stuck?
Open a ticket on our Discord with your framework, your poggy_core version and what you see, and we'll help you get it running.
Get help on Discord