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 organisationoverextended GitHub organisationhttps://github.com/overextended before starting the script:
| Resource | Where to get it |
|---|---|
| ox_lib | github.com/overextended/ox_lib |
| ox_target | github.com/overextended/ox_target |
| oxmysql | github.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_selldrugs3. 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
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
},
},
}Config.Trust = {
AddTrust = 0.20, -- trust gained per successful sale (%)
RemoveTrust = 0.10, -- trust lost per failed/rejected sale (%)
}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:
{
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:
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
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/qCDt8u7Efgdiscord.gg/qCDt8u7Efghttps://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/scriptssleepycode.eu/scripts/scripts.