Bring more action and realistic robbery opportunities to your ESX server with our Trailer Robbery Script! This script allows players to execute strategic heists on static truck trailers found all over the map. It's a perfect addition to any server economy looking for new criminal activities.
This script is designed from the ground up for stability, easy configuration, and maximum customizability.
⭐ Key Features
Police Requirement: Heists can only be started if a configurable number of police officers are on duty. This ensures fair and exciting roleplay!
Item Requirement: Players need a specific tool (e.g., a crowbar) to begin the break-in process.
Dynamic Object Detection: The script automatically finds all matching trailers on the map. You don't need to manually enter any coordinates!
Randomized Loot: You define which items can be found in the trailer and their probability. Every robbery is different!
Secure Stash System: Uses
ox_inventory's server-side stash system to securely and reliably manage the loot.Interactive Progress: An animated progress circle from
ox_libmakes the break-in process immersive and engaging.ESX Native: Fully integrated with ESX, using its native functions for maximum compatibility and performance.
🛠️ Installation & Configuration
Installation is incredibly simple:
Download the script and place it in your
resourcesdirectory.Add
ensure trailer_robto yourserver.cfg.Customize the
config.luato your liking (min police count, required item, loot table, etc.).
That's it! No complex database changes or deep code adjustments are necessary.
🔧 Advanced Customization
We know that every server is unique. That's why this script is built to let you easily swap out key systems:
Notification System: Adapt the notifications to your own system. In the
client/cl_utils.luafile, you can integrate your preferred system (e.g.,pnotify,okokNotify,esx_notify) with just one line of code.Police Dispatch System: The police alert is also fully customizable. In the
server/sv_utils.luafile, you can edit thealertPoliceevent to connect it with your dispatch system (ps-dispatch,cd_dispatch, Discord webhooks, etc.).
📦 Dependencies
Ensure the following resources are installed and working correctly on your server:
ESX Framework (tested with Legacy)
ox_lib
ox_inventory
xsound
📷 Screenshots
config.lua
client/cl_utils.lua
server/sv_utils.lua
InGame (breaking into a trailer)