Page cover

Configuring Weapon Models

This page will outline and explain how to create a new configured weapon model for the resource.


model_name

This variable contains a string representing the name of the taser model. It will be included in all webhook log entries and incorporated into the taser's unique identifier. This allows for effective tracing of the specific taser.

model_name = "TASER"

cartridge_count

This variable allows for the customization of the maximum number of cartridges the taser can hold. A standard taser typically holds two cartridges, but this can vary.

cartridge_count = 2

barbs_per_cartridge

This variable enables the customization of the number of barbs deployed per cartridge. If set to 4, four individual barbs or prongs will be discharged each time the taser is activated.

barbs_per_cartridge = 2

prong_penetration_chance

This variable enables customization of the default penetration chance. A lower value decreases the likelihood of the taser successfully completing a full circuit and being effective. This setting can be overridden by the cfg.ClothingPenetrationChance section in the configuration file.

prong_penetration_chance = 100

max_fire_distance

This variable enables customization of the taser's firing distance. By default, it is set to 10.0.

max_fire_distance = 10.0

has_safety_switch

This variable enables the full deactivation of the taser's safety feature. When set to false, the taser will operate without requiring the safety to be toggled and will remain continuously armed.

has_safety_switch = true

sound_effects

This table enables the customization of all sound effects used by this taser. This allows each taser to have its own unique sounds. You can edit each sound file, set the maximum distance at which the sound can be heard, and adjust the base volume of the sound.

sound_effects = {
    firing_sound = {
        file_name = "taser-fire.wav",
        distance = 15.0,
        volume = 1.0
    },
    shock_sound = {
        file_name = "taser-effect.wav",
        distance = 15.0,
        volume = 0.7
    },
    spark_sound = {
        file_name = "drive_stun.wav",
        distance = 15.0,
        volume = 0.7
    },
},

lasers

This table enables customization of the taser's lasers, including the number of lasers, their colors, and, where applicable, the offset from the previous laser. You may add as many or as few lasers as desired. The offset from the previous laser ensures proper spacing, preventing overlap and maintaining distinct positioning.

lasers = {
    [1] = {
        colour = vector4(0, 255, 0, 255)
    },
    [2] = {
        colour = vector4(255, 0, 0, 255),
        offset_from_previous = vector3(0.0, 0.0, -0.3)
    }
},

flashlight

This table enables customization of the taser's built-in flashlight, including options to enable or disable the flashlight feature, specify its effective distance, and adjust its brightness.

flashlight = {
    has_flashlight = true,
    distance = 25.0,
    brightness = 5.0
}

Last updated