Skip to content

Configuration

The script offers several configuration options to adapt to your FiveM server. You can modify these settings to adjust the features according to your needs.

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

Here are the parameters you can customize:

Config = {}
Config.Debug = true
Config.Locale = "fr"
-- ============================================================================
-- GRENADE SETTINGS
-- ============================================================================
Config.WeaponName = 'WEAPON_LAUGHGRENADE'
Config.AmmoName = 'AMMO_LAUGHGRENADE'
Config.GrenadeActivationDelay = 1500
Config.GrenadeRange = 10.0
Config.GasDuration = 30000
Config.EffectDuration = 15000
Config.EffectCheckInterval = 200
Config.MaxThrowDistance = 50.0
Config.DisableWeapons = true
-- ============================================================================
-- IMMUNITY SETTINGS
-- ============================================================================
Config.EnableMaskImmunity = true
Config.ImmunityMasks = {
drawables = {
46, -- Gas Mask
47, -- Gas Mask variant
48, -- Pilot Mask
121, -- Hazmat Mask
},
}
-- ============================================================================
-- LAUGH ANIMATIONS
-- ============================================================================
Config.LaughAnimations = {
{ dict = 'noko@rire', anim = 'clip' },
}
-- ============================================================================
-- PARTICLE EFFECTS
-- ============================================================================
Config.ParticleDict = 'core'
Config.ParticleName = 'exp_grd_bzgas_smoke'
-- ============================================================================
-- NOTIFICATION SYSTEM
-- ============================================================================
Config.SendNotification = true
Config.NotifyTitle = "Laugh Grenade"
Config.NotifyDuration = 5000
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"
elseif GetResourceState("ox_lib") == "started" then
Config.Notify = "ox_lib"
end
Config.CustomNotify = function(message, nType, duration)
-- Example with your own export:
-- exports['my_notify']:ShowNotification(Config.NotifyTitle, message, nType, duration)
-- Default fallback: GTA help text
BeginTextCommandDisplayHelp("STRING")
AddTextComponentSubstringPlayerName(message)
EndTextCommandDisplayHelp(0, false, true, duration)
end
if Config.Debug then
print("[DEBUG] Config.Notify: " .. Config.Notify)
end
-- ============================================================================
-- SOUND SYSTEM
-- ============================================================================
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 = 1,
}
  • Debug: Enable debug mode (true/false). If true, debug messages will be shown in the console.

  • Locale: Language used for messages (e.g. “fr” for French).

  • WeaponName: The weapon name of the funny grenade.

  • AmmoName: The ammo name of the funny grenade.

  • GrenadeActivationDelay: Delay before the grenade activates after being thrown (in milliseconds).

  • GrenadeRange: The effect radius of the grenade (in meters).

  • GasDuration: Duration of the gas effect (in milliseconds).

  • EffectDuration: Duration of the funny animations on affected players (in milliseconds).

  • EffectCheckInterval: Interval to check for affected players to apply animations (in milliseconds).

  • MaxThrowDistance: Maximum distance the grenade can be thrown (in meters).

  • DisableWeapons: Disable weapons of affected players during the effect duration (true/false).

  • EnableMaskImmunity: Enable immunity for players wearing certain masks (true/false).

  • ImmunityMasks: List of masks that grant immunity to the funny grenade, defined by their drawable IDs.

  • LaughAnimations: List of laugh animations (randomly chosen) to apply to affected players, defined by dictionary and animation name.

  • ParticleDict: Particle dictionary used for the grenade visual effects.

  • ParticleName: Particle name used for the grenade visual effects.

  • SendNotification: Enable sending notifications (true/false).

  • NotifyTitle: Title displayed on notifications (when supported by the notification system).

  • NotifyDuration: Default notification duration in milliseconds.

  • 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 is found, it uses the default system.

  • SoundSystem: Sound system to use. The script automatically detects popular systems (xsound, interact-sound, evo_sound). If none is found, it uses a custom system. Set it to custom to use the configuration in Config.Sound.

  • Sound: Custom sound configuration (if SoundSystem is set to “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 each change to the configuration file, restart the script or server for the changes to take effect.
  • If a parameter is not recognized, make sure it is spelled correctly and placed in the correct section of the file.