SleepyCode
Home
AboutBlogSubscriptionDocs
Cart0
SleepyCode
Cart0
  1. Home
  2. /
  3. Guides
6 min read

Guide · June 28, 2026

How to Install SleepyCode Selldrugs on FiveM ESX

Installation guide for SC Selldrugs - ESX drug-selling script for FiveM. Dependencies, server.cfg, config.lua options and troubleshooting tips.

SC Selldrugs is an ESX-only drug-selling script for FiveM roleplay servers. Players approach random pedestrian NPCs and attempt to sell configurable items. A police-check system, trust mechanic, and time-window restriction keep the economy balanced and RP-friendly.

Framework: ESX Legacy only. This script does not support QBCore or Standalone.

Dependencies

Install all three from the overextended GitHub organisation before starting the script:

ResourceWhere to get it
ox_libgithub.com/overextended/ox_lib
ox_targetgithub.com/overextended/ox_target
oxmysqlgithub.com/overextended/oxmysql

Installation Steps

1. Place the resource

Extract the downloaded folder (from Keymaster after purchase) and place it inside your server's resources directory.

2. Add to server.cfg

Add the following lines in the correct order - dependencies must start before the script:

ensure ox_lib
ensure ox_target
ensure oxmysql
ensure sc_selldrugs

3. No SQL import needed

Selldrugs does not require any manual database table creation. There is no .sql file to import.

4. Configure the script

Open config.lua and adjust the settings to fit your server. The most important options are covered below.

5. Restart and test

Restart the resource or reboot your server. Approach any random pedestrian NPC in-game and you should see an ox_target interaction label appear.

Key Config Options

lua
Config.Others = {
  MaxSellAmount   = 5,       -- max items a player can sell in one transaction
  RequiredPolice  = 1,       -- minimum online police officers required to sell
  PoliceJobName   = "police",
  Chance          = 50,      -- % chance the NPC accepts the offer

  AllowedSalesTime = {
    isActive = true,
    Time = {
      From = 0,   -- hour (0-23) selling is allowed from
      To   = 23,  -- hour (0-23) selling is allowed until
    },
  },
}
lua
Config.Trust = {
  AddTrust    = 0.20,  -- trust gained per successful sale (%)
  RemoveTrust = 0.10,  -- trust lost per failed/rejected sale (%)
}
lua
Config.Target = {
  Icon     = "fa-solid fa-comments",
  Label    = "Porozmawiaj",  -- label shown on the NPC interaction
  Distance = 2.5,            -- ox_target detection distance (metres)
}

Sellable Items

Items are defined in Config.Items. Each entry looks like this:

lua
{
  item        = "weed",      -- inventory item name
  from        = 50,          -- minimum sell price
  to          = 150,         -- maximum sell price
  label       = "Weed",      -- display name in the UI
  description = "...",
}

Add or remove entries from the table to match the items available on your server. Make sure the item value exactly matches the item name in your ox_inventory or ESX inventory setup.

Restricting Sell Hours

To allow selling only at night (e.g. 20:00-04:00), set:

lua
AllowedSalesTime = {
  isActive = true,
  Time = { From = 20, To = 4 },
}

Set isActive = false to allow selling at any time regardless of in-game hour.

Notifications

All notification messages (success, failure, no police, time restriction, etc.) are fully customisable in Config.Notify. Each notification has a title, description, type, and duration field.

Progress Bar

lua
Config.ProgressBar = {
  Duration = 5000,  -- milliseconds the selling animation plays
  Label    = "Trwa sprzedawanie...",
}

Common Issues

NPC interaction label not showing - Confirm ox_target is started before sc_selldrugs in server.cfg.

"RequiredPolice" check never passes - Make sure the police job name in config matches the actual ESX job name on your server (default: "police").

Items not appearing in the sell menu - The item value in Config.Items must exactly match the item registered in your inventory resource (case-sensitive).

Support

For help, join the SleepyCode Discord at discord.gg/qCDt8u7Efg. Include your ESX version, ox_lib version, and the full server console error when asking for support. You can buy the script at sleepycode.eu/scripts.

The script

Don't have Sell Drugs yet?

See the product page

On this page

  1. 01Dependencies
  2. 02Installation Steps
  3. 03Key Config Options
  4. 04Notifications
  5. 05Progress Bar
  6. 06Common Issues
  7. 07Support
Next

More guides

  • How to Install SleepyCode Bus Job on FiveM ESXStep-by-step install guide for SC Bus Job - ESX public transport script for FiveM. Dependencies, server.cfg, pay-per-stop config and multipliers.Read →
  • How to Install SleepyCode Garages V1 on FiveM ESXFull installation guide for SC Garages V1 - ESX garage system for FiveM. SQL setup, dependencies, config.lua options, commands and showroom.Read →
Ready when you are

Put your server on something that holds up

150+ servers run our resources - ESX, QBCore and standalone. Once the payment clears, the package is waiting in Keymaster.

Browse the catalogueAsk on Discord ↗
  • Delivered instantly
  • Support with no expiry
  • 100+ reviews
  • Payment via Tebex

SleepyCode

FiveM Scripts

Checkout is run by Tebex Limited - they handle payment, invoicing and refunds. © 2026

Community

  • Discord
  • YouTube
  • X (Twitter)

Navigation

  • Home
  • All Scripts
  • ESX Scripts
  • QBCore Scripts
  • Free Scripts
  • About
  • Blog
  • Documentation
  • Support

Legal

  • Privacy Policy
  • Tebex Privacy Policy
  • Terms of Service
  • Impressum

© 2026 SleepyCode. Not affiliated with Rockstar Games or Take-Two Interactive.

Powered byTebex