Skip to content

Adding items, traders & peds

Items live in bs_inventory/config/config_items.lua, in Items.Definitions. On start they are synced into bs_item_definitions, so you only edit the file.

my_tin = { label = 'Tinned Peaches', category = 'food', weight = 0.4, w = 1, h = 1, stack = 5,
usable = true, value = 14, data = { hunger = 25, thirst = 5 } },
  • w / h is the grid size, stack the max per slot, value the catalogue value traders are balanced around.
  • data depends on the category: heal, hunger, thirst for consumables, weapon = 'WEAPON_X' for weapons, handled = true when another resource consumes it.
  • Icons come from bs_ui/html/js/icons.js. No icon means a generic one, it still works.
  • Want it translated? The label can get a key in bs_inventory/locales/<lang>.lua, see Languages.

Restart bs_inventory when it’s quiet (people’s inventories reload). More detail on the Inventory page and for code in Items & inventory.

To test it, give it to yourself from F10 > ITEMS, or from code:

exports.bs_inventory:GiveItem(src, 'my_tin', 3)

Recipes sit in the same file. A recipe with factionBase = true only crafts inside your faction’s flag radius.

Traders are in bs_traders/config/config_traders.lua, Traders.Traders. Each one is placed relative to a safe zone:

trader_sandy = {
label = 'Camp Trader', role = 'trader', clothing = true,
zone = 'sandy_camp', offset = vector3(-6.0, 4.0, 0.0), heading = 30.0,
model = 'a_m_m_farmer_01', scenario = 'WORLD_HUMAN_STAND_IMPATIENT',
buys = { { item = 'scrap_metal', price = 3 } },
sells = { { item = 'my_tin', price = 20, stock = 30 } },
},
  • buys is what the trader pays players, sells what players can buy, stock limits it.
  • The shipped file keeps sells at about 1.4 to 1.5x the item value and buys under it. Stick to that or the economy breaks fast.
  • role = 'quest' with missions = { ... } makes a job giver, missions are in Traders.Missions.
  • Global.traderPriceMultiplier in F1 scales all buy prices.

Restart bs_traders to apply. If you changed a safe zone the map page on the website is drawn by hand from these files, so it won’t follow on its own.

A custom ped is a normal FiveM stream resource, nothing BS19-specific: a folder with your model files in stream/, a peds.meta that registers the model, and a manifest that hands the meta to the game.

files {
'peds.meta',
}
data_file 'PED_METADATA_FILE' 'peds.meta'

Put it in resources/[local]/, ensure it in your server.cfg, and the model name works anywhere a ped model does, like a trader’s model. bs_zombiepeds is exactly this and nothing else, so copy it as a template.

If the model never appears, it’s almost always the model name: the name in peds.meta and the name you use in a config have to be the same word, and the resource has to be running.

Streaming a model doesn’t make walkers use it. They pick from Zombies.ModelPools in bs_zombies/config/config_zombies.lua, one pool per kind of area, each entry a model name and a weight:

Zombies.ModelPools = {
urban = { { 'u_m_y_zombie_01', 3 }, { 'bsz_walker_a', 2 }, { 'my_zombie', 2 } },
...
}
  • The number is the relative chance inside that pool, so 3 is picked about three times as often as 1.
  • Zombies.PoolAreas forces a pool inside a circle: Fort Zancudo and Bolingbroke are military, the police stations police, the hospitals medical. Anywhere else is rural north of y = 1000 and urban below it.
  • brute is the pool used for the brute type everywhere on the map.
  • Zombies.FallbackModels is what spawns when a pool is empty or your add-on fails to load. Keep a base-game model in there, it’s the thing that saves you from invisible zombies.
  • Animal models (a_c_*) are skipped, so a dog add-on won’t become a walker.
  • Zombies.Models underneath is built from the pools at load. Don’t edit it by hand.

Restart your stream resource and bs_zombies. If every walker still looks stock, the model failed to load and the fallback took over.

The look of a walker (torn clothes, blood, missing components) is separate and comes later in the same file, and the gait and behaviour live in the archetypes, see Adding zombie types.