Adding items, traders & peds
A new item
Section titled “A new item”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/his the grid size,stackthe max per slot,valuethe catalogue value traders are balanced around.datadepends on the category:heal,hunger,thirstfor consumables,weapon = 'WEAPON_X'for weapons,handled = truewhen 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)A recipe
Section titled “A recipe”Recipes sit in the same file. A recipe with factionBase = true only crafts inside your faction’s flag radius.
Putting it on a trader
Section titled “Putting it on a trader”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 } },},buysis what the trader pays players,sellswhat players can buy,stocklimits it.- The shipped file keeps sells at about 1.4 to 1.5x the item
valueand buys under it. Stick to that or the economy breaks fast. role = 'quest'withmissions = { ... }makes a job giver, missions are inTraders.Missions.Global.traderPriceMultiplierin 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
Section titled “A custom ped”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.
A custom zombie
Section titled “A custom zombie”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
3is picked about three times as often as1. Zombies.PoolAreasforces a pool inside a circle: Fort Zancudo and Bolingbroke aremilitary, the police stationspolice, the hospitalsmedical. Anywhere else isruralnorth of y = 1000 andurbanbelow it.bruteis the pool used for the brute type everywhere on the map.Zombies.FallbackModelsis 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.Modelsunderneath 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.
bs19.org · Privacy · Terms · Cookie settings
Cookies and outside content
The site only needs two essential cookies to keep you logged in and protect forms. Videos and streams from YouTube and Twitch load from their servers, which can set their own cookies, so they stay off until you say yes. Nothing is pre-ticked and you can change your mind any time with "Cookie settings" at the bottom of every page. Details.
Questions about the server, the framework or the site? A real person reads this, usually within a day.