Skip to content

Configuration

The script offers several configuration options to fit your FiveM server. You can modify these parameters to adjust features according to your needs.

  • The configuration file is located in the shared folder, named config.lua.
  • Open this file with a text editor (such as Notepad++, Visual Studio Code or even Notepad 😜).

Here are the parameters you can customize:

Config = {}
Config.Debug = false
Config.Locale = "en"
Config.Electric = false
Config.Duration = 8000
Config.VisualEffectDuration = 10000
Config.Cooldown = 5000
Config.OnlyVictim = false
Config.Key = {
key = "F1",
register_mapping = false,
}
Config.Degats = {
default = 1,
electric = 1.05,
}
Config.Particle = {
PedBone = 24818,
fxName = "des_tv_smash",
effectName = "ent_sht_electrical_box_sp",
scale = 1.2,
}
Config.SyncDistance = 5
Config.Notify = "default"
if GetResourceState("mythic_notify") == "started" then
Config.Notify = "mythic_notify"
elseif GetResourceState("k5_notify") == "started" then
Config.Notify = "k5_notify"
elseif GetResourceState("FL-Notify") == "started" then
Config.Notify = "FL-Notify"
elseif GetResourceState("dillen-notifications") == "started" then
Config.Notify = "dillen-notifications"
elseif GetResourceState("noxen_notify") == "started" then
Config.Notify = "noxen_notify"
elseif GetResourceState("wasabi_notify") == "started" then
Config.Notify = "wasabi_notify"
end
if Config.Debug then
print("[DEBUG] Config.Notify: " .. Config.Notify)
end
Config.SoundSystem = ""
if GetResourceState("xsound") == "started" then
Config.SoundSystem = "xsound"
elseif GetResourceState("interact-sound") == "started" then
Config.SoundSystem = "interact_sound"
elseif GetResourceState("evo_sound") == "started" then
Config.SoundSystem = "evo_sound"
else
Config.SoundSystem = "custom"
end
if Config.Debug then
print("[DEBUG] Config.SoundSystem: " .. Config.SoundSystem)
end
Config.Sound = {
url = "",
volume = 0.1,
}
  • Debug: Enable debug mode (true/false). If true, debug messages will be shown in the console.

  • Locale: Script language (e.g., “fr”, “en”, “de”, “es”, “ru”).

  • Electric: If true, electricity is always active on the baton.

  • Duration: Duration (in milliseconds) of the electric effect when activated.

  • VisualEffectDuration: Duration (in milliseconds) of the particle visual effect.

  • Cooldown: Duration (in milliseconds) before the electric effect can be reused.

  • OnlyVictim: If true, only the player hit by the baton will have visual effects.

  • Key: Configuration of the key to toggle electricity (default is F1).

    • key: Key to use (e.g., “F1”, “E”, “G”).
    • register_mapping: If true, register the key in FiveM control settings.
  • Degats (Damage): Damage multipliers.

    • default: Multiplier for damage without electricity.
    • electric: Multiplier for damage when electricity is active.
  • Particle: Particle effect settings.

    • PedBone: Character bone where the effect will be attached (Bone list here).
    • fxName: Name of the particle effect (must be loaded in the game).
    • effectName: Specific effect name to use.
    • scale: Particle effect scale.
  • SyncDistance: Distance (in meters) to synchronize visual effects with other players.

  • Notify: Notification system to use. The script automatically detects popular systems (mythic_notify, k5_notify, FL-Notify, dillen-notifications, noxen_notify, wasabi_notify). If none detected, it uses the default system.

  • SoundSystem: Sound system to use, with similar automatic detection for popular sound systems (xsound, interact-sound, evo_sound), else uses a custom system.

  • Sound: Custom sound configuration (if SoundSystem is “custom”).

    • url: URL of the audio file to play (must be a direct link to a compatible audio file or a YouTube URL).
    • volume: Sound volume (value between 0.0 and 1.0).
  • After any change to the configuration file, restart the script or the server to apply changes.
  • If a parameter is not recognized, check for correct spelling and placement in the right section of the file.