Systems Overview

Architecture, tool behavior, bombs, sync, repairs, sounds, and hooks

Architecture

  • shared/config.lua controls tools, bombs, repair rules, skill checks, hooks, language, debug, engine bone, and blacklists.

  • client/client.lua sets target options, plays animations, applies local sabotage effects, and triggers server events.

  • server/server.lua tracks sabotage state, registers useable items, handles repair cleanup, and resyncs joining players.

  • install/ITEMS.lua includes example item definitions for ox_inventory and qb-inventory.

  • install/sounds/ includes the sound files and notes for coordinate-based playback.

circle-info

Net events use the envi-sabotage: prefix. Exports use envi-sabotage-v2.

Tool behavior

All tools share these config fields:

  • enabled

  • item

  • prop

  • offsets

  • breakChance from 0 to 100

  • runtime entity and active values, which should stay at their defaults

Tool list

  • Impact Driver removes wheels.

  • Spanner loosens wheel nuts. Wheels can fall off above wheelFallOffSpeed MPH.

  • Pliers cut brakes. Failure happens near noBrakesSpeed MPH.

  • Adjustable Spanner sabotages the accelerator and reverses acceleration behavior.

  • Drill creates a fuel leak. Leak behavior uses leakSpeed MPH and your fuelExport(vehicle) hook.

  • Buzz Saw removes doors. It can place and pack up a world saw entity. keyToDrop defaults to 73.

  • Screwdriver sabotages electrics. Cut-outs happen near cutOutSpeed with cutOutChance.

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 remoteBomb plus the detonator item, usually phone_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.RepairJob

  • Config.RepairTime

  • Config.RealisticRepair

  • Config.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:

  • FixWheelNuts

  • FixGasTank

  • FixBrakes

  • FixAcceleration

  • FixElectrics

  • RepairAll(vehicle)

Sounds and minigames

Sounds

Tool sounds use InteractSound coordinate playback.

Relevant config values:

  • SawVolume

  • ImpactDriverVolume

  • DrillVolume

Expected sound file names:

  • saw

  • impactdrill

  • drill

Install the sound assets and any required coord playback handlers from install/sounds/readme.txt.

Minigames

  • Config.MiniGame is the master toggle.

  • skillCheckEasy

  • skillCheckFast

  • skillCheckLong

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:fixAll clears all enabled sabotage states for a vehicle.

  • envi-sabotage:deleteEntity deletes 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:

  • enabled

  • addictionType

  • per-action point values

Editable hooks

  • onFireStarted(coords) runs when fire starts.

  • fuelExport(vehicle) handles your fuel script integration.

  • Config.BlacklistedVehClasses blocks GTA vehicle classes.

  • Config.EngineBone lets 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