Scripts
Advanced Electrical Job
Someone's gotta keep the lights on. Crews fix electrical faults across the city through a timed wiring puzzle.
- Requires
- ox_lib
- Frameworks
- ox, qb, qbx & esx, switch with one config line
- Target & inventory
- ox or qb, or your own
- Vehicle keys
- qbx or qb, or your own
#Install
#Install dependencies
Install (or update)
ox_lib, and start it before this script in yourserver.cfg.github.com/CommunityOx/ox_lib/releases
0
#Check your inventory, target, keys and notify
Besides
ox_lib, the script needs an inventory, a target, vehicle keys and notifications. Pick yours undersysteminconfigs/cl_config.lua:oxandqbresources work out of the box, andqbx_vehiclekeysorqb-vehiclekeysfor keys.Using something else? Make your own in
utils/cl_utils.luaandutils/sv_utils.lua. These are the calls the script makes, shown with theoxand Qbox resources:lua-- Server side return exports.ox_inventory:AddItem(source, item, count, metadata or nil)lua-- Client side return exports.ox_target:addSphereZone({ coords = data.coords, radius = data.radius or 1.0, debug = data.debug or false, options = utils.getTargetOptions(data.options) }) return exports.ox_target:addLocalEntity(entity, utils.getTargetOptions(options)) exports.ox_target:removeZone(zone)lua-- Client side lib.notify({ title = data.title or '', description = data.description or '', type = data.type or 'info', position = data.position or 'bottom', duration = data.duration or 3000, }) -- Server side TriggerClientEvent('ox_lib:notify', data.source, data, 'bottom')lua-- Server side return exports.qbx_vehiclekeys:HasKeys(data.source, data.vehicle) exports.qbx_vehiclekeys:GiveKeys(data.source, data.vehicle, true)#Pick a minigame
Repairs use a minigame. The built-in one works straight away, or pick one you already run with
minigameundersysteminconfigs/cl_config.lua:Setting Minigame 'l3th'Built-in (default), nothing to install 'ox'ox_lib skill check 'tgg','akilla','jomidar','lunar','glitch'That minigame resource, if you have it Want another one? Add it in
utils/cl_utils.lua.#Start the script
- Put the
l3th-electricaljobfolder in your resources folder - Add
ensure l3th-electricaljobto yourserver.cfg, after its dependencies - Restart the server
- Put the
#Configuration
Go through configs/cl_config.lua and configs/sv_config.lua and set them up to your liking.
#Need help?
Most issues come from a missing dependency or the wrong start order in server.cfg, so run through the steps once more first. Still stuck? See Common problems or open a ticket on Discord.