Skip to content

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

OptionDefaultWhat it does
Config.Probes10Probes per magazine
Config.Range13.7Probe range in metres (45 ft). Keep WireLength above it
Config.CycleTime5Seconds per energy cycle; any probe hit is a full cycle
Config.WireLength15.0Barbs rip out past this distance
Config.WireColor{ 200, 200, 200, 170 }The wires' colour and alpha
Config.BarbDepth0.02Metres the probe sinks past the hit point

Drive stun

OptionDefaultWhat it does
Config.DriveStunfalseThe TASER 10 has none: ARC only re-energises or warning-arcs. true adds it
Config.DriveStunRange1.5Metres
Config.PainTime1500Milliseconds of ragdoll for a drive stun
Config.DriveStunLockoutfalsetrue: a drive stun alone locks out. false: only when it completes a circuit with a barb

Laser, light and sound

OptionDefaultWhat 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.ShowDistance60.0Draw other players' laser and light within this range
Config.SoundRange30.0Metres sounds carry
Config.Volume0.60-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:

  1. /tasercal shows the weapon's axes (X red, Y green, Z blue) and the laser origin (yellow).
  2. Adjust live with /tasermuzzle x y z and /taseraxis x y z (only you see it).
  3. 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.