Picture of the authorSX Development

Taser

Take your law enforcement roleplay to the next level with our Advanced Taser System. Realistic probe deployment with physics based rope mechanics, laser aiming systems, tactical flashlight with strobe capability and synchronization that ensures all players see the same action. Perfect for Law Enforcement roleplay and tactical training scenarios.

Installation

Download the Script

Download Advanced Taser using the Cfx Portal.

Download the Dependencies

Download the latest ox_lib GitHub.

Download Taser Model (Optional)

The Taser model used in the showcase is from Waterhey. Simply drag and drop the Coil C9 folder into your resources folder.

Server.cfg Configuration

Add the following lines to your server.cfg to ensure the required resources are loaded:

server.cfg
ensure ox_lib
ensure sx_taser

Configuration

config.lua
TaserConfig = {
    Language = 'en', -- en, de

    -- Taser weapons and variants available: 'TASER7', 'X2'
    WeaponHashes = {
        [`WEAPON_STUNGUN`] = 'TASER7'
    },
    RopeId = 8, -- Rope ID for the taser rope

    TaserDamage = false,

    MinStungunGroundTime = 5000,
    MaxStungunGroundTime = 10000,

    Volume = 0.3, -- 0.0 to 1.0

    Safety = {
        Keybind = 'C',
        Notify = true,
    },

    Flashlight = {
        Keybind = 'E',
    },

    Reload = {
        Keybind = 'R',
        Duration = 2 -- Duration of the reload animation in seconds
    },

    DriveStun = {
        Keybind = 'X'
    },

    UI = {
        X = 0.015,
        Y = 0.81,
        Scale = 0.8
    },

    HandleNotifications = true, -- if HandleNotifications set to false, the function underneath (NotificationHandler) will be called.

    NotificationHandler = function(type, title, description)
        --Playing Notification Sound
        /*
         SendNUIMessage({
            event = "playSound"
         })
        */

        --ESX
        /*
         ESX = exports["es_extended"]:getSharedObject()
         ESX.ShowNotification(title .. " / " .. description, type)
        */

        --QB
        --TriggerEvent("QBCore:Notify", { text = title, caption = description })
    end,
}

Troubleshooting

  • Ensure ox_lib is installed and started before sx_taser.

On this page