QBCore mechanic job script: build a garage players actually enjoy
A good QBCore mechanic job script is more than a repair menu. It gives a player a clear shift, a believable garage workflow, useful progression and enough server-side validation that one bad client cannot print money or repair every vehicle on the map.
Mechanic jobs are one of the best ways to give a FiveM roleplay server a reliable everyday loop. Players bring damaged cars to a shop, mechanics diagnose the problem, parts are consumed, payments are recorded and the job creates reasons for other players to interact. The official QBCore mechanic resource describes the familiar building blocks: duty and clock-in locations, job vehicles, a stash, repair areas and vehicle-part status values.[1] The challenge is joining those pieces into a resource that feels coherent on a live server.
Start with the job loop, not the menu
Before writing Lua, write down what a complete mechanic shift looks like. A practical loop might begin with the player clocking in, checking the workshop board, taking a service vehicle or opening a repair bay, inspecting a customer vehicle, quoting a price, completing the repair and clocking out. Each step should have a reason to exist. If the mechanic can teleport into a menu and click “repair all”, the job will feel like a command rather than a role.
Decide which parts are simulated. A lightweight script can focus on engine and body health. A deeper version can add brakes, clutch, axle, radiator and fuel components. Keep the first release readable: show the part, its current condition, the required item and the time or interaction needed. Players should understand what they are paying for without reading your source code.
| System | Good first version | Common mistake |
|---|---|---|
| Duty | Clock in near the garage and expose job actions only while on duty. | Trusting a client flag that says the player is working. |
| Repair | Require a vehicle, a valid bay and the correct repair item. | Accepting vehicle IDs, prices or item counts from the client. |
| Payment | Calculate the quote on the server and log the transaction. | Letting the client choose the reward amount. |
| Progression | Use ranks, unlocks or reputation after successful jobs. | Giving rewards every time an event is fired. |
Plan the QBCore data contract
Write the data contract before the event names. You need to know what the server must remember: the player source, citizen ID, active duty state, shop or garage, the vehicle being serviced, the selected part, the quote, the start time and whether the repair is already complete. An active repair record should belong to the server and expire if the player leaves, disconnects or abandons the bay.
Keep configuration separate from runtime state. Configuration can contain garage coordinates, authorized job grades, available vehicles, repair items, prices and animation timings. Runtime state should live in a table keyed by player source or a server-generated repair ID. Never edit a “currently attached vehicle” field in configuration as if it were a permanent setting; live state belongs in memory or a datastore designed for it.
Ask Stellar AI for a complete QBCore mechanic job script with fxmanifest.lua, separate client and server files, config-driven garages, duty state, repair bays, item costs, server-side validation, cleanup on disconnect and a test checklist. State the exact framework version and dependencies before asking for code.
Security belongs on the server
FiveM clients can trigger networked events, so a mechanic resource must assume that every client argument can be changed. Cfx.re’s security guidance recommends server-side checks for money, inventory, position, state, experience, permissions and roles.[2] In practice, that means the server should retrieve the player object, confirm the mechanic job and grade, verify the player is near the garage, check that the target vehicle is valid, check that the player owns or is authorised to service it, and calculate the cost itself.
For example, a client can request “start repair on engine”, but the server decides whether the source is on duty, whether the vehicle is within the repair bay, whether engine repair is enabled, whether the required item exists and what the repair duration and price are. The client can display progress; it should not be the authority that grants items, cash or permanent status.
-- server-side shape, not a drop-in resource
RegisterNetEvent('mechanic:server:startRepair', function(repairId, part)
local src = source
local player = QBCore.Functions.GetPlayer(src)
if not player or player.PlayerData.job.name ~= 'mechanic' then return end
if not isOnDuty(src) or not isValidBay(src, repairId) then return end
if not Config.Parts[part] then return end
-- Re-read inventory, price and vehicle state here.
beginRepairForSource(src, repairId, part)
end)
Make the garage feel like a real workplace
Small details create the roleplay. Use a clear shop identity, a compact dispatch board, a mechanic-only stash and a vehicle list that reflects the server’s economy. Give the player a visible reason to move around: one interaction for duty, one for parts, one for bays and one for vehicles. Avoid covering the screen with five overlapping menus. A simple interaction flow is usually more premium than a long settings panel.
For customers, make the quote and outcome obvious. Show which part is being repaired, what the estimated price is, and whether the mechanic is using a shop item or a customer-supplied item. For staff, show active work and completed jobs. If you add reputation, reward completed validated repairs rather than raw event counts so players cannot farm progress by repeatedly triggering the same callback.
Test it like a server owner
Test the happy path first, then test the resource as if you were trying to break it. Check clock-in and clock-out, reconnects, death, vehicle deletion, two mechanics using the same bay, missing items, wrong job grades, invalid part names, long distances, duplicate repair requests and a player leaving mid-repair. Also test a server restart: configuration should load cleanly and no stale repair record should grant a reward after the restart.
Keep a short release checklist with the exact dependencies, resource start order, database requirements, coordinates, item names and commands. The official QBCore mechanic documentation includes configuration examples for vehicles, locations, repair costs and authorised commands, which makes it a useful compatibility reference even when your resource is custom.[1]
Generate a better first draft with a precise brief
If you are using AI to create the first version of a QBCore mechanic job script, do not ask for “a mechanic job” and hope the missing details appear. Ask for the framework, dependencies, exact files, event names, item names, garage coordinates, payment rules, job grades, test cases and security assumptions. Then review the output file by file. An AI-generated script is a starting structure, not proof that the resource is secure or compatible with your server.
You can use Stellar AI’s scripting workspace to plan the system, generate complete files, ask follow-up questions and request a test matrix before installing it. Keep the generated resource private until you have tested it on a separate development server.
Need the first structure?
Describe your garage locations, job grades, parts and payment rules. Stellar AI can help you turn that brief into a reviewable QBCore resource.
Build a mechanic system →