RP Works Modding Docs
DocsStore
  • โฑ๏ธGetting Started
  • โ“Frequently Asked Questions
  • ๐ŸŒFiveM Resources
  • ๐ŸšจFiveM Lighting System [FLS]
  • ๐Ÿ“FLS Pattern Designer
  • โ˜๏ธDynamic Weather System
  • ๐Ÿ“นFree Camera Mode
  • ๐ŸฅŽHold and Throw
  • ๐ŸงจFlashbang
  • ๐Ÿš’BA Board
  • ๐Ÿ”ZoneCues [COMING SOON]
  • ๐Ÿง SceneAI [Coming Soon]
  • ๐Ÿ”‘Trakka Key Management [Coming Soon]
Powered by GitBook
On this page
  • ๐Ÿš€ Features
  • ๐Ÿงฑ Installation
  • ๐ŸŽฏ How It Works
  • ๐Ÿ“ค Exports
  • โš™๏ธ Configuration
  • ๐Ÿ”Š Custom Audio

Flashbang

A fully featured, standalone flashbang system for FiveM with realistic effects, AI interaction, and 3D audio support.

PreviousHold and ThrowNextBA Board

Last updated 4 days ago

๐Ÿš€ Features

  • ๐Ÿ’ฅ Custom addon flashbang weapon with 0-damage frag explosion

  • ๐Ÿ’ฅ Single flashbang or multi-banger (9-banger) support

  • ๐Ÿ‘๏ธ Configurable masks dampen the effects (like gas masks or sunglasses)

  • ๐ŸŽง Full 3D positional audio using native GTA explosions

  • ๐Ÿ‘๏ธ LOS and directional detection โ€” players only get blinded if they see the detonation

  • ๐Ÿง  Realistic flash effects: whiteout, blurred vision, drunk movement, and ear ringing

  • ๐Ÿงโ€โ™‚๏ธ NPCs react with panic, ragdoll, and flee behavior

  • ๐ŸŽฎ Easy-to-use exports for full integration with other scripts

  • โš™๏ธ Fully configurable via config.lua

  • ๐Ÿ“ฆ Flashbang 3D model and custom add-on weapon included


๐Ÿงฑ Installation

Follow instructions in

Ensure that the dependancies are started BEFORE this resource in server.cfg


๐ŸŽฏ How It Works

  • Players throw the flashbang (addon weapon).

  • After a realistic cook time (configurable), the grenade explodes with a visual and audio effect.

  • Nearby players are:

    • Fully flashed if they were looking at it and had line of sight.

    • Partially disoriented if they were nearby but not looking directly.

    • Unaffected if behind solid cover.

  • NPCs are stunned or flee if within range and have line of sight.


๐Ÿ“ค Exports

Client Exports

Export
Description

Applies flash effect on the local player

Returns true if the player is currently flashed

Triggers a flashbang effect manually

Returns the current flashbang config table


โš™๏ธ Configuration

Config = {
    FlashbangRadius = 15.0,        -- Max distance for full effect
    StunDuration = 5000,           -- Time the player is disoriented
    CookTime = 2000,               -- Time from throw to detonation
    FlashAffectsNPCs = true,       -- Enable AI reactions
    FlashIntensity = 1.0           -- from 0.1 (light) to 1.0 (full)
}

Config.AntiFlashMasks = {
    [36] = true, -- example: ID of mask model
    [52] = true, -- add as many as you need!
}

Config.MaskProtectionStrength = 'partial' -- options: 'none', 'partial', 'full'

Config.MultiFlashbang = {
    enabled = true -- Whether this should be a nine-banger or a single flash/bang
}

๐Ÿ”Š Custom Audio

To use custom audio for the flashbang, find your chosen .mp3 file and replace flashbang.mp3 within the html/ folder

exports["RPW_Flashbang"]:TriggerFlashEffect(coords)
exports["RPW_Flashbang"]:IsPlayerFlashed()
exports["RPW_Flashbang"]:DetonateFlashbang(coords)
exports["RPW_Flashbang"]:GetFlashbangConfig()
Getting Started
๐Ÿงจ
Page cover image