A complete walkthrough of writing a small but production-ready job script for ESX or QBCore, from manifest to multi-step duties.
Almost every server has at least one job written in-house. Knowing how to build a clean one is one of the highest-leverage skills a server developer can have.
Create a folder [jobs]/myjob. Inside, you need three files: fxmanifest.lua, client.lua, server.lua. The manifest declares your scripts, the client handles markers / target zones / UI, the server handles money, inventory, and validation.
A job is just a state machine. Player starts a duty, hits a series of checkpoints, completes the cycle, gets paid. Everything else — animations, vehicles, props — is decoration.
Every payment must happen on the server, period. The client tells the server I finished step 3 but the server checks if the player is actually at the right coordinates and within a reasonable time window. This single rule prevents 95% of money-farm exploits.
Use the framework's player object methods. xPlayer.addMoney() for ESX. Player.Functions.AddMoney() for QBCore. Don't write directly to the database from a job script — let the framework handle that.
A good job is 200 lines of clean code, not 2,000 lines of spaghetti. If your script is getting bigger than a coffee shop menu, you have probably mixed UI, payment, and state management — split them into separate files and you will wonder why you didn't sooner.
Written by
Alex Johnson
Questions? Browse our products or contact us