Free FiveM crime scripts: drug selling, house robbery, lockpick and safe-cracking minigames for ESX
X3D's free gang-side set for ESX — X3D Sell Drug (buyers rotate around the map, pay black money), X3D House Robbery (pick, loot, crack the safe, per-house cooldown), X3D Lockpick and X3D Safe Cracking (minigames behind one export). Everything is checked server side, with notes on wiring them into what you already run.
An RP server with only police and honest jobs goes quiet fast. The gang side needs things to do that are not standing at one spot pressing a key, and they must be hard to exploit or the city economy collapses within a week.
X3D gives away four scripts that chain together: sell drugs to rotating buyers, rob houses for loot, and two minigames (lockpick, safe dial) any script can call. Sell Drug and House Robbery run on ESX or standalone (Config.Framework = 'auto'), and the two minigames are framework-free.
Related scripts
X3D Sell DrugShady buyers appear around the map on a timer and pay in black money. Runs on ESX or standalone.Free
X3D House RobberyPick the door, search the floor, crack the safe, with a cooldown per house and both minigames in the same zip.Free
X3D LockpickA lockpick minigame felt out with WASD, called with one export and usable from any script.Free
X3D Sell Drug — buyers rotate around the map
The problem with typical drug-selling scripts is the fixed corner: police camp it, sellers get bored. Here shady buyers appear at random map spots (with a blip) on a timer; when it runs out they vanish and a new one appears elsewhere.
- Each buyer wants different items and quantities, runs their own clock, first come first served, no repeat sales to the same buyer
- Pays black money, straight into your laundering loop
- Spots, items, prices, timers, concurrent buyers and banned jobs in
shared/config.lua - With ox_lib running there is a negotiation minigame (skill check) before the sale; failing it means no sale. Without ox_lib it is skipped
- Big-buyer events (1.2.0) appear on a random timer with a city-wide announcement, buy 10 units per deal at normal price × 1.2, take 3 minutes per sale (cancellable), and everyone may sell once per event. Admins can start one from the X3D Admin Panel or with
exports.x3d_selldrug:StartEvent(group) Hooks.OnSold(src, sale)inaddons/hooks/server.luafor XP, quests or logs after each sale
Download X3D Sell Drug · Guide
X3D House Robbery — pick, loot, crack the safe
The whole loop in one resource: press E at a house that has not been hit → lockpick minigame → search the spots inside → the safe has its own dial minigame and better loot → press E at the door to leave. The house goes on cooldown and its marker turns red.
- Separate loot tables for floor and safe with chance and quantity; optional inventory-weight check (off by default)
- Houses, entry/exit, search spots, safe position, search time, pin count and cooldown in
config.lua - A keycard (
keycard_red/keycard_gold/keycard_silver) is needed to break in. Its colour picks the safe's loot table, and a failed lockpick can break it - Minigames come from X3D Lockpick and X3D Safe Cracking when installed, otherwise the ox_lib skill check (
Config.Minigame = 'auto'). Since 1.2.0 the minigames no longer ship in the zip; they are separate free downloads Config.BlockedJobsstops chosen jobs, such as police, from robbing
Download X3D House Robbery · Guide
X3D Lockpick and X3D Safe Cracking — minigames in one line
These are the minigames House Robbery uses, split out so any script can call them: car doors, crates, drawers, bank vaults, whatever you build.
-- Lockpick: feel for the pin with WASD, 4 = pin count (3–6 is a good range)
local ok = exports['x3d_lockpick']:miniGameLockPick(4)
-- Safe: turn the dial with A/D, press E on the notch, 4 = lock count
local opened = exports['x3d_safe']:createSafe(4)
if ok then --[[ open the door ]] end
if opened then --[[ give the safe loot ]] end
- Returns
true/falsedirectly, no callbacks, no events to chase - Sets the
LocalPlayer.state.minigamestate bag while running so the inventory and other keys stay blocked, and firesx3d_lockpick:active/x3d_safe:activefor your HUD - Dying mid-game or stopping the resource closes the minigame and returns
false; nobody gets stuck - Safe Cracking uses GTA's own
MPSafeCrackingtexture andSAFE_CRACKsounds, nothing streamed, zero dependencies
Download X3D Lockpick · Download X3D Safe Cracking
Why they are hard to exploit
Sell Drug and House Robbery check every point where money or items change hands on the server:
| Common exploit | Typical script | This set |
|---|---|---|
| Client claims "I have the item" | Trusted | Server verifies the item before taking it |
| Start the deal, run away | Still paid | Distance checked at the end, not just the start |
| Spam the key / replay the event | Multiple payouts | One player per deal, no repeat sales to the same buyer |
| Skip the wait | Client says done | Server tracks elapsed time itself |
| Hit the same house repeatedly | Allowed | Per-house cooldown on the server |
With the ESX Legacy Core — X3D Build every black-money and item change from these scripts also lands in the core's audit log and Discord webhooks.
Install
ensure x3d_lockpick
ensure x3d_safe
ensure x3d_selldrug
ensure x3d_houserobbery
3D markers and the E prompt are built in. Progress bars and notifications pick whatever you run (ox_lib / X3D Progress Bar / esx_progressbar, X3D Notify / esx_notify) and fall back to natives. Thai/English strings via Config.Locale.
FAQ
Which inventory do I need? — None in particular; standard ESX items. The weight check is optional and only used if your inventory supports it.
Do police find out about a sale or a break-in? — Yes. Since 1.2.0 both scripts have Config.Alert: chosen jobs (such as police) get a message and a temporary red circle on the map. Sell Drug alerts with a chance per sale (30% by default), House Robbery alerts on a successful break-in, and both can delay the alert.
Can I require police online first? — Yes. Config.RequiredJobs = { police = 2 } counts on-duty players only, and House Robbery checks again after the minigame.
Can admins see every buyer spot or house? — Yes. Config.AdminBlips = true shows them to admins only, or toggle them from the X3D Admin Panel page.
QBCore? — Sell Drug and House Robbery have ESX and standalone modes, with no built-in QBCore mode; adapt the functions in addons/framework/ yourself. Lockpick and Safe Cracking work on any core.
All 16 free X3D scripts are in the free FiveM scripts post.
Related scripts
X3D Sell DrugShady buyers appear around the map on a timer and pay in black money. Runs on ESX or standalone.Free
X3D House RobberyPick the door, search the floor, crack the safe, with a cooldown per house and both minigames in the same zip.Free
X3D LockpickA lockpick minigame felt out with WASD, called with one export and usable from any script.Free