FiveM Drug Selling Not Working? Every Fix
A player opens a ticket: “I have twenty bags and nobody buys.” You check the script, it’s running, nothing is red in the console. You join, grab some bags, start selling yourself, and get “There are not enough Police on duty” while three officers are standing next to you.
Drug selling breaks in quiet ways. It’s rarely a crash. It’s one check in a chain of five or six quietly saying no, and most scripts only tell you which one in a short notification. I’ve written drug selling three times and answered these tickets for years, and the causes are almost always the same handful.
Here they are, in the order I’d check them. I use qb-drugs for the examples, because it’s the one most servers start with and its code is open, and I point out where other scripts differ. If you haven’t set up drugs at all yet, start with how to make custom drugs in FiveM and come back.
How a Drug Sale Actually Works
Every drug selling script, free or paid, runs the same chain before money changes hands:
- The player starts selling. A command, a radial menu entry or a target option.
- The script finds something to sell. It checks the player’s inventory against its own list of sellable items.
- The location check. Inside a sale zone, or close to where selling started.
- The police check. Enough officers on duty, counted the way that script counts them.
- A buyer. A ped that’s allowed to buy, walks over and accepts.
- The payout. The server removes the item and pays into an account.
If any link says no, the sale doesn’t happen. So the fastest way to fix it is to work out which link failed. The message the player sees usually tells you, if you know what each one means.
1. The Item Isn’t on the Script’s Price List
Symptom on qb-drugs: “You aren’t carrying any drugs with you”, from a player whose pockets are full of drugs.
qb-drugs doesn’t sell whatever is in your inventory. When selling starts, its server loops over Config.DrugsPrice and only offers items listed there that the player carries. Anything else is invisible to it.
-- qb-drugs/config.lua
DrugsPrice = {
['weed_whitewidow'] = { min = 15, max = 24 },
['cokebaggy'] = { min = 18, max = 37 },
['meth'] = { min = 18, max = 40 },
-- your custom drug has to be here too
['bluesky'] = { min = 20, max = 45 },
},
This bites every server that adds its own drug. The item exists, it shows up in the inventory, it can even be used, but nobody told the selling script about it. The fix is one line in the price table and a restart of qb-drugs.
Two more things to check while you’re there:
- The name matches exactly.
weed_skunkandweed-skunkare different items. Copy the name from your items file, don’t retype it. - The item exists in the framework’s item list. qb-drugs reads the label from qb-core’s shared items. If you’re adding the item itself as well, how to add items in FiveM covers every inventory, and if it has no picture, see FiveM inventory images not showing.
Other scripts call it something different (a sellable flag on the item, a drugs table in the config), but the idea is the same: the selling script has its own list, and your item has to be on it.
2. The Police Count Is Stuck at Zero
Symptom: “There are not enough Police on duty (2 required)” while officers are clearly on duty.
This is the one that confuses people most, because the police are right there. The problem is almost never the number of officers. It’s how the script finds out that number.
qb-drugs doesn’t count officers itself. It keeps a number on each player’s client, CurrentCops, which only changes when it receives the police:SetCopCount event, and compares that against Config.MinimumDrugSalePolice. That event comes from qb-policejob. In qb-policejob’s server code, an officer counts only when two things are true:
-- qb-policejob/server/main.lua
if v and v.PlayerData.job.type == 'leo' and v.PlayerData.job.onduty then
amount += 1
end
So the count stays at zero, or goes stale, in these cases:
- Your police job isn’t type
leo. qb-core’s defaultpolicejob setstype = 'leo'. A sheriff or state job you added yourself without that line never counts, no matter how many officers clock in. - They’re off duty. The
ondutyflag has to be true. If your duty system is a separate script, check it really sets QBCore’s duty, not just its own. - You replaced qb-policejob. If your police job script doesn’t send
police:SetCopCount, qb-drugs’ number never moves from zero. Any minimum above 0 then blocks selling forever. - Duty changed somewhere else. qb-policejob sends a fresh count when someone loads in, when an officer toggles duty through it, and every ten minutes. Officers who go on duty through another script can wait up to ten minutes before the drug script notices.
The quick test: set MinimumDrugSalePolice = 0, restart qb-drugs and try again. If selling works, it was the police count, and the list above tells you which part.
On ESX, the usual way to count is every player with the police job, on duty or not, which is the opposite problem. If you’re writing the check yourself, building a FiveM drug system the hard way has the server-side count for QBCore, Qbox and ESX.
3. They’re Not Where the Script Wants Them
Symptoms: “Moved too far away” on qb-drugs, or a message like “nobody buys around here” on zone-based scripts.
qb-drugs has no sale zones. Corner selling starts wherever the player stands, and if they move more than 10 units from that spot, it stops with “Moved too far away”. Players who walk towards a buyer, or chase one who robbed them, end their own session without realising it. It also refuses to start in a vehicle (“Can’t sell while in a vehicle”).
Scripts with sale zones have the opposite problem. Selling only works inside a polygon someone drew, and if the player is a few metres outside it, or the zone is too thin vertically to cover a hill or a second floor, nothing happens.
If you drew the zone yourself with ox_lib:
- Turn on
debug = trueon the client zone and walk it. You’ll see the walls in game. - Check the
thickness. A zone drawn at street level with a small thickness misses rooftops and slopes. - Make sure the client and the server use the same points. If the server checks
zone:contains(coords)with an older copy of the points, the client shows “Offer” and the server quietly refuses. Keep both in one shared config.
4. Nobody Walks Up
Symptom: selling is on, no error, and no buyer ever comes.
On qb-drugs, a buyer is the closest ped within 15 units that isn’t in a vehicle, isn’t a player and isn’t an animal. On an empty street, in an alley, or in an interior with no ambient peds, there’s simply nobody to pick.
There’s also a roll that catches people out. In qb-drugs’ client code, a random number from 1 to 100 at or below Config.SuccessChance (50 by default) makes the script skip that ped. Despite the name, raising SuccessChance means more peds ignore you, not fewer. Each ped is also only tried once per selling session, so standing in one spot burns through the nearby peds quickly.
Other scripts spawn their own buyers instead of picking ambient peds. If those never arrive, check the buyer’s spawn distance and model list in the config, and whether the spot you’re on is somewhere a ped can actually walk to.
5. The Sale Happens but the Money Doesn’t
Symptom: the progress bar finishes, the drugs leave the inventory, and the player swears they got nothing, or almost nothing.
Three causes, from most to least common:
- It paid into a different account. Many scripts pay in dirty money. On QBCore that’s often
markedbillsor ablack_moneyitem, depending on the script and inventory, and on ESX it’s theblack_moneyaccount. Players check their cash, see no change and open a ticket. Check what your script pays into before you go hunting for a bug. - It was a scam or a robbery. qb-drugs has
ScamChance(25%), which drops the offer to $3 to $10 per bag, andRobberyChance(25%), where the buyer takes the bags and runs. If the robber ends up dead, the player can search them to get the bags back. Both are working as intended, but at 25% each they’re often what players are reporting. - The inventory calls don’t match your inventory. qb-drugs’ server code calls
exports['qb-inventory']directly to remove items. If you run it with a different inventory, check how it handles those calls before you trust it on a live server.
6. Nothing Starts It, or There’s No Option to Click
Symptom: players can’t find how to start selling, or the target option never shows.
qb-drugs has no chat command for corner selling. It’s started by the Corner Selling entry in qb-radialmenu, which fires qb-drugs:client:cornerselling. If you replaced or trimmed the radial menu, nothing starts it until you add an entry or a command that triggers that event.
Whether offers use qb-target or a press-E prompt depends on the UseTarget convar, not on the config file. Add setr UseTarget true to server.cfg to use qb-target, and leave it out for the prompt. A mismatch here, such as a server without qb-target that sets the convar, leaves players with no way to accept an offer.
7. The Police Never Get an Alert
Not a selling bug, but it gets reported as one. qb-drugs calls the police by triggering police:server:policeAlert, with a 99% chance per sale by default (PoliceCallChance). qb-policejob handles that event and sends it to officers who are type leo and on duty. Replace qb-policejob or use a dispatch script that doesn’t listen for that event, and the alerts silently go nowhere. The fix is the same as for the police count: check your police job and dispatch script actually speak to each other.
Fixing Drug Selling With LMX Drug Creator
Full disclosure: this is our script. It’s the third version of our drug selling script, and a lot of what’s above is why it tells you what’s wrong instead of failing quietly.
The LMX Drug Creator is $39.99 one-time, for ESX, QBCore and Qbox. For each cause above, here’s what its docs say it does:
- Items: a drug’s items are made and published from the in-game editor, and each item card shows Draft, Waits for a restart or In inventory. A drug can’t go live until every item it names is in your inventory, and the checks say which one is missing.
- Police count:
Config.Police.Jobslists the jobs that count (police,sheriff,statetrooper,fbi,usmarshallby default), andOnDutyOnlycounts only officers on duty where your framework tracks it. The server counts at the start of every offer, stage, planting and bulk deal, so the number is fresh each time. Each drug, or each stage, sets its own Police online. Players see “Not enough police in the city.” when it’s above the officers on duty. - Zones: players outside every sale zone see “Nobody buys around here.” Draw one by walking its corners, or set
Config.Selling.RequireZone = false. - Buyers:
/dealerbrings buyers to you. “You already tried this person.” means that ped is on its cooldown (PedCooldownMinutes, 10 by default), and “Buyer got lost.” means a buyer couldn’t reach the player and the next one comes sooner. - Heat: busy zones heat up. At full heat, 35% more buyers say no and prices drop 20%, so “nobody’s buying” on a corner that’s been hammered all night can be heat. Zones shows each zone’s heat.
- Interaction:
Config.Target = 'auto'uses ox_target or qb-target and falls back to press-E prompts, and the console saysInteractions are off. Check Config.Target.when it finds nothing. - Alerts: dispatch goes through ps-dispatch, cd_dispatch, core_dispatch, rcore_dispatch, qs-dispatch or a built-in alert, and falls back to the built-in one if the chosen script stops.
- The status line:
/drugcreatorshows your framework, inventory and version, with every problem found at start listed under it.
Where it falls short, honestly:
- On ESX with the older
esx_serviceduty system, ESX itself reports every officer as on duty, so every officer counts. The docs are clear that this is ESX’s data, not a setting the script can change. - ox_inventory needs one paste step, once, at your first publish. After that, publishing restarts ox_inventory for a few seconds, which clears items on the ground and temporary stashes.
- Not everything is tested in game yet. ps-dispatch and the built-in alert are. cd_dispatch, core_dispatch, rcore_dispatch, qs-dispatch and qs-inventory are built from their docs.
- It needs OneSync, ox_lib and oxmysql, and the folder has to stay named
lmx_drugcreator.
If qb-drugs does what you want and the list above got it working, keep it. It’s free and open. The Drug Creator is for when you want your own drugs, zones and police rules without editing config files, and want the script to tell you which check failed.
Drug Selling FAQ
Why does it say not enough police when officers are on?
The script can’t see them. On qb-drugs that means the officers aren’t a job of type leo, aren’t on duty in QBCore’s eyes, or your police script doesn’t send police:SetCopCount. Set the minimum to 0 to confirm, then fix the job or the police script.
How do I add my own drug to qb-drugs?
Add the item to your items file, then add it to Config.DrugsPrice with a min and max price. Restart qb-drugs. It won’t be sold until it’s in that table.
Why do players get robbed so often?
qb-drugs’ RobberyChance is 25 by default, so roughly one in four buyers who walk up will rob the seller instead of paying. Lower it in the config if that’s too harsh for your server.
Can players exploit drug selling? Yes, if the payout trusts the client. The price, the count and the location should all be decided on the server. FiveM events explained covers why any client can fire any registered event.
Does qb-drugs work on ESX? It’s written for QBCore and uses QBCore’s player functions and qb-inventory exports. On ESX you’d need a different script, a bridge, or to write your own.
Are there free drug scripts? Yes. qb-drugs and qb-weed are the usual QBCore starting points, and our free FiveM scripts page lists other tools worth having on any server.
Still stuck after all seven? Post the script, your framework, the exact message players see and your police job setup in our Discord, and we’ll find which check is failing.