[ESX/QBCore] Drug Dealer Script

Trase.Dev’s ESX/QBCore Drug Dealer System

Trase_Dealer is an advanced drug dealer script for FiveM. It allows players to sell drugs or other illegal items. Create ranks with exclusive perks, enhancing the gameplay experience. Connect whitelisted discord roles to give supporters exclusive modifications such as increased sell percentages. Our script support both ESX and QBCore, our script is also very easy to install.


  • Optimized with 0.00ms
  • Configure individual items (drugs), set prices and deny chance.
  • Configurable menu to select drug (optional)
  • Ranks, the more a user sells the more they can unlock and can be configured in the config
  • Discord Roles, set certain discord roles to have certain features. (allows donors to get a % increase)
  • Blacklist certain coords and jobs.
  • Built in police alerting system.
  • Protected from modders


Config (Shared)
Config = {}

-- Configure all drugs on server config.

Config.Framework = 0 -- ESX = 0, QBCore = 1, Custom = 2 (For custom, setup in frameworks/custom.lua)
Config.SellCommands = { 'dealer', 'selldrugs', 'trap' } -- Commands that are used to sell drugs
Config.EnableSelection = true -- Enable the context menu to select the drug IF they have more then 1
Config.SpawnDistance = 50.0 -- The distance the peds are spawned from the player
Config.DefaultSellTime = 12 -- Time (in seconds) it takes to sell on level 1

Config.BlacklistedJobs = { -- A list of jobs that cannot do /dealer

Config.BlacklistedLocations = {
    vec4(0.0, 0.0, 0.0, 25.0), -- X, Y, Z, Radius

Config.Police = {
    Enabled = true,
    Job = 'police'

Config.DenyStrings = {
    'This stuff is shitty!',
    'I want the real shit, what is this?!',
    'This shit wack.',

Config.Strings = {
    ['NoDrugs'] = 'You have no drugs to sell!',
    ['MenuTitle'] = 'Select Drug Option',
    ['NoClientFound'] = 'No clients were found, try moving around.',
    ['ClientFound'] = 'Client found, they\'re approaching now.',
    ['ClientScared'] = 'The client got scared and ran away.',
    ['NoInVeh'] = 'You can\'t sell drugs while in a vehicle.',
    ['SoldDrug'] = 'You sold {DRUG_NAME} for ${DRUG_PRICE}.',
    ['RankUp'] = 'Congrats! You have sold a total of {TOTAL_DRUGSALE} drugs and ranked up to {RANK_LABEL}!',
    ['SellIncrease'] = 'You got a {DRUG_MULTI}% sell increase due to your rank!',
    ['SellIncreaseDiscord'] = 'You got a {DRUG_MULTI}% sell increase due to being a donator!',
    ['AlertPolice'] = 'A suspect spotted selling drugs!',
    ['BlacklistedJob'] = 'You are not allowed to sell drugs with this job!',
    ['CantSellHere'] = 'You cannot sell drugs here!',
    ['CurrentlyDrugRank'] = 'You are currently rank {DRUG_RANK}, and have sold a total of x{DRUG_TOTALSOLD} drugs!'

Config.PedModels = { -- List of peds that are selected when selling

Config.Ranks = {
    [1] = {
        RankLabel = 'Rank: 2',
        SellRequirement = 100,
        Modifiers = {
            SellTime = 10, -- The time (in seconds) it takes to sell the drug on the phone with the ped
            SellPrice = 10 -- Sell 10% more
    [2] = {
        RankLabel = 'Rank: 3',
        SellRequirement = 500,
        Modifiers = {
            SellTime = 8, -- The time (in seconds) it takes to sell the drug on the phone with the ped
            SellPrice = 15 -- Sell 15% more
    [3] = {
        RankLabel = 'Rank: 4',
        SellRequirement = 750,
        Modifiers = {
            SellTime = 6, -- The time (in seconds) it takes to sell the drug on the phone with the ped
            SellPrice = 20 -- Sell 20% more
    [4] = {
        RankLabel = 'Rank: 5',
        SellRequirement = 1000,
        Modifiers = {
            SellTime = 4, -- The time (in seconds) it takes to sell the drug on the phone with the ped
            SellPrice = 25 -- Sell 25% more
Config (Server)
while (not Config) do Wait(100) end

Config.PayType = 'black_money' -- ESX = "money", "bank", "black_money" | QBCore = "cash", "markedbills"
Config.RandomizePay = true -- If enabled, it will add a random number 1-200
-- Please keep in mind, if you use marked bills disable the option above and change the prices. (QBCore)

Config.Command = {
    Enabled = true,
    Command = 'dealerrank'

Config.Drugs = {
    [1] = {
        Label = 'Coke',
        Item = 'coke_bag',
        Price = 2000, 
        RequiredAmount = 1,
        DenyChance = 0
    [2] = {
        Label = 'Meth',
        Item = 'meth_bag',
        Price = 2000, 
        RequiredAmount = 1,
        DenyChance = 0

Config.Discord = {
    Enabled = false, -- Requires: https://github.com/ImTrase/trase_discord
    ResourceName = 'trase_discord', -- In case you renamed the resource.
    Roles = {
        [1] = {
            RoleID = 1094982744133619782,
            SellPrice = 25 -- Sell 25% more (adds on to the rank)


My Other Resources:

Code is accessible Yes & No (Alot of the code is open, with only core parts being locked, but there is also a option to purchase the source code)
Subscription-based No
Lines (approximately) ~669
Requirements ox_lib
Support Yes

Pretty similar to this

1 Like

Yes I am aware, but the sole difference being the ranks with modifications and allowing of whitelisted discord roles. I made this script privately for a server where a lot of people wanted a script similar to it, so I decided to release one.

On top of that, this one allows for further configuration for drugs, such as the progress bar speed time and more.

I plan to also update my script in the future with some more ways to sell, still working on the ideas of it but hopefully that update will release sometime soon.

bro i hate how no one converted that for qbcore

what happens if you turn off selection?

The peds only spawn client side … So police can’t do surveillance on dealers (other than seeing them do a texting animation) . It also makes it so if someone is trapping with a friend their friends only see their own customer . Is there a way to fix this issue ? I love the script and how it works its just that one thing with it .

Maybe an update to make it an option in the config ?

Hey! Sorry for late response, I have been bust recently. But I pushed an update that does just that :slight_smile: Let me know if you have any issues.

Can you add the option to sell more than 1 bag at a time? I want to sell random bags from 1-5.

Can you change the blacklist option around to where you can only sell in areas of the coords you want?
I want to sell in specific areas only. The way you have it set up is to list the coords of the areas you don’t want to sell in and that’s a lot of work.

Yeah there are some functions that are open that you can edit to do just that, if you create a ticket in my discord I can provide further assistance on how to do that.

1 Like

Im using Qbcore and peds are only showing on the client side. Were you able to fix the issue for qb core because i dont see the option in the config?

okay i got the script now where can i put it in qbcore or somewhere else i have qbcore thank you

where to find the drugs please and thank you


  • Fixed an issue when using discord integration

  • Fixed a bug where players were getting increased for discord roles they didn’t have

  • Added a config option to only allow drug selling at night time

  • Added a debug option for further support (leave disabled unless requested by us to be enabled)

  • Added new config option “Config.Command.Cooldown” an option to set a cooldown to prevent users from spamming /dealer

  • Added version checker, if outdated version it will print in console

  • Fixed marked bills on QBCore, the item should now work properly.

  • Fixed the “framework” folder accidentally being escrowed.

  • Added a check for when you configure non-existing drugs

  • Added new “Props”, when you are selling drugs so it makes it more realistic and looks like an actual handoff for the drugs.

  • Added Config.SyncPeds to make peds server-side and sync them across all players

  • Added Config.Agressive (optional to make peds attack the player upon denial)

  • Added new supported dispatch scripts to alert after denied sale! (optional)
    ➜ qs-dispatch
    ➜ ps-dispatch
    ➜ cd_dispatch


  • Fixed/Added “RequiredAmount” value, can now have it as a table then a random value will be chosen.* (Random Drug Sale Amounts, highly requested)*
  • “open.lua” on the server is now not escrowed for people with encrypted version
  • “functions.lua” on the client is now not escrowed for people with encrypted version