Systems Overview
Architecture, tool behavior, bombs, sync, repairs, sounds, and hooks
Architecture
shared/config.luacontrols tools, bombs, repair rules, skill checks, hooks, language, debug, engine bone, and blacklists.client/client.luasets target options, plays animations, applies local sabotage effects, and triggers server events.server/server.luatracks sabotage state, registers useable items, handles repair cleanup, and resyncs joining players.install/ITEMS.luaincludes example item definitions forox_inventoryandqb-inventory.install/sounds/includes the sound files and notes for coordinate-based playback.
Net events use the envi-sabotage: prefix. Exports use envi-sabotage-v2.
Tool behavior
All tools share these config fields:
enableditempropoffsets
breakChancefrom0to100runtime
entityandactivevalues, which should stay at their defaults
Tool list
Impact Driver removes wheels.
Spanner loosens wheel nuts. Wheels can fall off above
wheelFallOffSpeedMPH.Pliers cut brakes. Failure happens near
noBrakesSpeedMPH.Adjustable Spanner sabotages the accelerator and reverses acceleration behavior.
Drill creates a fuel leak. Leak behavior uses
leakSpeedMPH and yourfuelExport(vehicle)hook.Buzz Saw removes doors. It can place and pack up a world saw entity.
keyToDropdefaults to73.Screwdriver sabotages electrics. Cut-outs happen near
cutOutSpeedwithcutOutChance.
When a tool breaks, the resource removes the item through the server-side item removal path.
Bombs and fire
Ignition Bomb rigs on the engine area.
Impact Bomb creates an out-of-control style explosion trigger.
Remote Bomb uses
remoteBombplus the detonator item, usuallyphone_bomb.Speed Bomb uses
speedToActivate,speedToExplode,explodeTimer, and optional beeps or notifications.Firelighter starts a vehicle fire with a server-randomized duration.
Bomb placement still depends on the hood being open. If the engine is not at the front, target the actual engine area and adjust Config.EngineBone if needed.
Remote bombs keep rig data in GlobalState.riggedVehicles. Only the player who rigged the bomb can request detonation. The script blocks duplicate rigs on the same vehicle or plate with the already_rigged language message.
Repairs
These config values control repair behavior:
Config.RepairJobConfig.RepairTimeConfig.RealisticRepairConfig.RepairAll
If Config.RealisticRepair is enabled, some fixes require the correct tool in hand and an under-vehicle context. This pairs well with lift-based mechanic flows.
Available repair exports:
FixWheelNutsFixGasTankFixBrakesFixAccelerationFixElectricsRepairAll(vehicle)
Sounds and minigames
Sounds
Tool sounds use InteractSound coordinate playback.
Relevant config values:
SawVolumeImpactDriverVolumeDrillVolume
Expected sound file names:
sawimpactdrilldrill
Install the sound assets and any required coord playback handlers from install/sounds/readme.txt.
Minigames
Config.MiniGameis the master toggle.skillCheckEasyskillCheckFastskillCheckLong
The default skill checks use ox_lib through lib.skillCheck. You can replace those functions with your own logic.
Server sync
Sabotage state is server-authoritative.
The server stores state per sabotage type.
Vehicles are usually keyed by network ID.
Some bomb paths also use the vehicle plate.
State changes broadcast to all clients.
Late joiners are resynced when the bridge player-loaded hook fires.
Useful internal behaviors:
envi-sabotage:fixAllclears all enabled sabotage states for a vehicle.envi-sabotage:deleteEntitydeletes the placed saw entity by network ID.
Optional integrations and hooks
Envi-Addictions
If Config.EnviAddictions.enabled is on, successful sabotage actions can award addiction points through envi-addictions.
Common values include:
enabledaddictionTypeper-action point values
Editable hooks
onFireStarted(coords)runs when fire starts.fuelExport(vehicle)handles your fuel script integration.Config.BlacklistedVehClassesblocks GTA vehicle classes.Config.EngineBonelets you correct the target bone for bomb rigging.
If you use the drill sabotage, wire fuelExport(vehicle) to your fuel resource before going live.
Last updated