How to add drugs to your FiveM server
To add drugs to a FiveM server, you install a drug script, register its items in your inventory and set three stages in its config: where ingredients come from, how they are processed and who buys the result. In our All-in-One Drug System V2 on ESX, QBCore or Qbox, one resource covers all three stages, and police risk comes from alert chances on each sale.
Two more of our scripts, Ownable Drug Labs and Drug Selling to NPCs, each cover part of it:
| Script | Ingredients | Processing | Selling | Police risk |
|---|---|---|---|---|
All-in-One Drug System V2 (tk_drugs) |
Plants in pots, picking fields, shops | Placed equipment with a minigame each, labs with NPC workers | Street NPCs and the Plug app | Alert chance on sales, deliveries and pickpocketing |
Ownable Drug Labs (esx_tk_drugs, qb_tk_drugs) |
None by default; each lab item can list a need |
The lab generates meth, coke or weed every 30 minutes by default | Darkchat offers from clients and dealers | Police raids, alerts on sales, a police count to sell |
Drug Selling to NPCs (esx_tk_selldrugs, qb_tk_selldrugs) |
None | None | Price negotiation with pedestrians | Alert and robbery chances, a police count to sell |
The steps that follow set up All-in-One Drug System V2. All file paths are inside tk_drugs.
Before you start
- A server running ESX, QBCore or Qbox, with oxmysql or mysql-async.
- ox_inventory, qb-inventory, qs-inventory or ESX’s own inventory, and optionally ox_target or qb-target.
- The two free model packs the README links: weed props and mushrooms.
- A game build that has the models. Our docs use build 3258.
Install the resource
- Put the
tk_drugsfolder in yourresourcesfolder. - In
server, add.cfg ensure tk_drugsafter your framework, oxmysql and your inventory. - Import
tk_drugsinto your database..sql - In
config, set.lua Configto.Framework 'esx'or'qb'. Qbox runs QBCore scripts through its QBCore bridge, so a Qbox server uses'qb'. - Set
Configto.Inventory 'ox'for ox_inventory (Qbox uses it),'qs'for qs-inventory, or'default'for the framework’s own inventory (ESX’s built-in inventory, or qb-inventory on QBCore). - Set
Configto.Target 'ox','qb'or'none', andConfigas described under police risk..Dispatch - Add the script’s items to your inventory. The README lists 133, in ox_inventory and qb-inventory format; the items guide shows where each format goes.
- Restart the server. The console shows no
tk_drugserror.
Set where ingredients come from
- In
Config, edit the two shops. The General Store sells seeds, pots, fertilizer, water, the precursors and the.Shops trap_phone; the Equipment Store sells ovens, tables, the press, lamps and shelves. Each line is an itemname, apriceand anamount. - In
Config, each seed lists the items it needs (a.Plants plant_potby default), its growthstagesand itsyield. Each stage has atime, but the last stage’s time has no effect: a plant dies only when its water or fertilizer reaches 0. - In
Config, set how fast water and fertilizer drain and.PlantSettings maxPlantsPerPlayer(100 by default). SetConfigif plants should grow only while their owner is online..OnlineOnlyGrowth = true - In
Config, set picking areas with a centre, a radius and the plants that spawn there. The default field grows three mushroom types and.Fields rye_ergot.
Heroin and LSD have no seed. For heroin, players buy poppy_resin and acetic_anhydride; for LSD, rye_ergot (also picked in the field) and diethylamine. Then they process them.
Set how drugs are processed
- In
Config, each piece of equipment is an item that places a prop, with.EquipmentItems recipesofneedandgetitems. The meth oven, for example, combines 3liquid_methand anempty_trayinto aliquid_meth_tray, and hammers ameth_trayinto 10meth. - Players buy equipment from the shop and place it. To put equipment at fixed spots instead, add entries to
Config..EquipmentLocations - Set
Configto allow equipment only inside labs, and list no-build zones in.PlaceOnlyInsideLabs = true Config..DisabledAreas - In
Config, set.PhoneSettings labPrice,maxOwnedLabs(1 by default) andsellPercentage, the share of the price a player gets back when selling a lab. Labs are bought from the trap phone and have meth, weed and coke interiors.
Set who buys and for how much
- In
Config, each street-sale drug has a.Selling .items pricerange, amaxAmountand abaseChance. Only items listed here sell to street NPCs; an empty table turns street selling off. - The more a player offers at once, the lower the chance: offering the full
maxAmounthalvesbaseChance. - Set
Configto the number of police who must be online before street sales work (0 by default), and.Selling .minPolice moneyTypeto the account sales pay into. - In
Config, set.PlugApp sellModeto'walkup', where the customer walks up to the player, or'delivery', where the player goes to the customer.
Set police risk
- In
Config, list the jobs that count as police (.PoliceJobs policeandsheriffby default). - In
Config, each activity has an alert chance. By default a failed street sale alerts police 50% of the time and a successful one never; a failed pickpocket alerts 25% of the time, and a Plug delivery 10%..PoliceAlerts - Set
Configto.Dispatch 'tk'for our Dispatch System or'cd'for cd_dispatch. Any other value, including the empty default, sends the script’s own alert to online players whose job is inConfig..PoliceJobs
Add a drug of your own
- Add the item to your inventory, as for the shipped items.
- Make it obtainable: add it to a recipe’s
getinConfig, or to a plant’s.EquipmentItems yield. - Add it to
Configwith a price range,.Selling .items maxAmountandbaseChance. - To make it usable, add it to
Configwith a.Drugs drugType, ananimationand itseffects. The comment beforeConfiglists the effects, from.Drugs RunningSpeedIncreasetoGlitterBomb.
Labs that produce on their own: Ownable Drug Labs
Ownable Drug Labs is a separate script, sold as an ESX package and a QBCore package that also runs on Qbox. Players buy one of 11 labs on a darkweb tablet (Config, darkweb_tablet). By default each lab generates 5 meth, weed or coke every 30 minutes with no ingredients; uncomment the need example under Config to make it use chemicals. Darkchat offers buy the drugs, and dealers appear once an area’s reputation reaches 100. Police can enter and seize items, and Config sets the police count for sales (1 by default). Other players destroy labs with bolt_cutters. The ESX package’s SQL file adds darkweb_tablet and bolt_cutters to the items table.
Selling only: Drug Selling to NPCs
Drug Selling to NPCs covers the selling stage alone, as an ESX package and a QBCore package that also runs on Qbox. It sells the items named in its Config, so it can sell drugs another script makes. The player names a price and the NPC counters. Config, Config (the chance applies when the NPC is not interested) and Config set the risk.
Check it works
- In
server, give your admin group the ACE permission for commands and add yourself to it, as the Cfx.re example server.cfg does with.cfg add_ace groupand.admin command allow add_principal./drugsadminmenuis a restricted command and opens only with that permission. - Give yourself an
og_kush_seedand aplant_pot, and use the seed to place a plant. The pot appears with the first growth stage in it. - Run
/drugsadminmenu. The plant is listed. Restart the server and run it again: the plant is still there.
The All-in-One Drug System V2 showcase runs 9:34 and shows each stage in game.
If it fails
Failed to load model x: the model comes from a newer GTA V game build. Update the server’s game build, or change that model name inconfig(our docs)..lua - The cursor sticks in the top-right corner: a client-side anticheat or another script is interfering with the menu. Change or remove that script.
- An item has no picture in the script’s menus:
Configdoes not point at your inventory’s image folder, or the PNG is missing there. The items guide has the paths..ImagePath


