Taser
Configuration
Everything is in lwk_taser/config.lua. Restart the resource after a change.
Framework and items
Config.Framework 'auto' | 'ox' | 'qb' | 'esx' | 'standalone' (default: 'auto')'auto' picks ox_inventory, then qb-core, then es_extended, then standalone (unlimited magazines).
Config.CartridgeItem string (default: 'taser_cartridge')
One item is one 10-probe magazine.
Weapons
Config.Weapons table
Any weapon listed here becomes a taser.
Config.Weapons = {
WEAPON_STUNGUN = { muzzle = vec3(0.163, 0.0006, 0.027) },
WEAPON_STUNGUN_MP = {},
-- WEAPON_MYTASER = { muzzle = vec3(0.20, 0.0, 0.05), axis = vec3(1.0, 0.0, 0.0) },
}
muzzle and axis are only needed if the model has no gun_muzzle bone or the laser points the wrong way.
Firing
| Option | Default | What it does |
|---|---|---|
Config.Probes | 10 | Probes per magazine |
Config.Range | 13.7 | Probe range in metres (45 ft). Keep WireLength above it |
Config.CycleTime | 5 | Seconds per energy cycle; any probe hit is a full cycle |
Config.WireLength | 15.0 | Barbs rip out past this distance |
Config.WireColor | { 200, 200, 200, 170 } | The wires' colour and alpha |
Config.BarbDepth | 0.02 | Metres the probe sinks past the hit point |
Drive stun
| Option | Default | What it does |
|---|---|---|
Config.DriveStun | false | The TASER 10 has none: ARC only re-energises or warning-arcs. true adds it |
Config.DriveStunRange | 1.5 | Metres |
Config.PainTime | 1500 | Milliseconds of ragdoll for a drive stun |
Config.DriveStunLockout | false | true: a drive stun alone locks out. false: only when it completes a circuit with a barb |
Laser, light and sound
| Option | Default | What it does |
|---|---|---|
Config.Laser | { color = { 40, 255, 40 }, range = 50.0 } | Laser colour and range |
Config.Light | { range = 25.0, brightness = 8.0, radius = 14.0 } | Flashlight |
Config.ShowDistance | 60.0 | Draw other players' laser and light within this range |
Config.SoundRange | 30.0 | Metres sounds carry |
Config.Volume | 0.6 | 0-1 |
Keys
Config.Keys table (default: { arc = 'X', light = 'H', laser = 'J', reload = 'R' })
Custom models
To keep your own taser model, delete stream/w_pi_stungun.ydr and w_pi_stungun_hi.ydr and add your weapon to Config.Weapons. The magazine, rear screen and muzzle offset are fitted to the shipped model, so expect to calibrate:
/tasercalshows the weapon's axes (X red, Y green, Z blue) and the laser origin (yellow).- Adjust live with
/tasermuzzle x y zand/taseraxis x y z(only you see it). - Paste the line printed in F8 into
Config.Weapons.
Config.Bays holds where each of the 10 wires leaves the gun, in firing order. Check them with Config.Debug on (numbers are drawn on the taser) and move one live with /taserbay n x y z, which prints the line to paste.
Config.BarbProp, Config.CartProp and Config.Reload are fitted to the shipped model and animation; leave them unless you change those.
Debug
Config.Debug boolean (default: false)
F8 prints barb placement error per hit, and bay numbers are drawn on the gun.
Stuck? Ask on Discord
View as Markdown