High Beams [ESX | QBCORE]

Add a realistic and fully synchronized Headlight Flasher to your server. This script allows players to press and hold a key to flash their high beams, an essential feature for realistic roleplay interactions on the road.

The script intelligently saves the vehicle’s previous light state (whether lights were on, off, or high beams were already active) and restores it perfectly upon key release.

GET IT HERE FOR FREE
VIEW PREVIEW

Changelog

V1.1

Changelog

v1.1.0 (Performance & Immersion Update)

Released: 2025-12-04

:rocket: New Features

  • OneSync Infinity Support: Added Config.UseOneSync to sync headlight events only to players within a specific range (Config.SyncRange). This significantly reduces server bandwidth usage.
  • NPC Reactions (Beta): AI vehicles in front of the player now react to high beams by trying to make way (toggleable via Config.NpcReact).
  • Audio Feedback: Added a subtle “click” sound effect when toggling the high beams (toggleable via Config.EnableSound).
  • Anti-Spam System: Implemented a cooldown timer (Config.Cooldown) to prevent players from spamming network events.

:bug: Bug Fixes & Improvements

  • Light State Logic: Fixed an issue where lights would turn off completely instead of reverting to low beams when releasing the key.
  • Network Safety: Improved ensureNetworkId validation to prevent errors with non-networked vehicles.
  • Config: Added new configuration options for all new features.


Core Features

  • :zap: OneSync Infinity Optimized: Network events are now distance-scoped. Flashing lights are only synced to players within a specific range (configurable), massively reducing server bandwidth usage compared to global broadcasts.
  • :brain: NPC Reactions (New): AI traffic in front of you can now react to your high beams by trying to move out of the way (toggleable).
  • :loud_sound: Audio Feedback (New): A subtle, realistic “click” sound plays when toggling the lever, adding to the immersion.
  • :shield: Anti-Spam Protection (New): Includes a configurable cooldown to prevent players from spamming the key and flooding the network.
  • :arrows_counterclockwise: Smart State Saving: The script remembers the exact original light state (off, low beams, or high beams) and restores it immediately after releasing the key.
  • :stopwatch: Hold-to-Flash: The high beams remain active only while the key is held down, mimicking real-life behavior.
  • :red_car: Driver-Only Mode: Configurable option to restrict usage to the driver’s seat only.
  • :boom: Broken Headlight Check: Realistic safety check that prevents usage if the vehicle’s headlights are damaged.
  • :keyboard: Custom Keybind: Uses FiveM’s RegisterKeyMapping, allowing every player to customize the key (Default: K) in their own GTA settings.
  • :rocket: Highly Optimized: Lightweight code structure with virtually 0.00ms idle usage and efficient network traffic management.
Screenshots



ezgif-6dedf237d0d47a37

Support here

OTHER RELEASES
Advanced Mechanic Tablet Script
Advanced Courier Script

Code is accessible No
Subscription-based No
Lines (approximately) 313
Requirements ESX OR QBCORE
Support Yes
5 Likes

Changelog

v1.1.0 (Performance & Immersion Update)

Released: 2025-12-04

:rocket: New Features

  • OneSync Infinity Support: Added Config.UseOneSync to sync headlight events only to players within a specific range (Config.SyncRange). This significantly reduces server bandwidth usage.
  • NPC Reactions (Beta): AI vehicles in front of the player now react to high beams by trying to make way (toggleable via Config.NpcReact).
  • Audio Feedback: Added a subtle “click” sound effect when toggling the high beams (toggleable via Config.EnableSound).
  • Anti-Spam System: Implemented a cooldown timer (Config.Cooldown) to prevent players from spamming network events.

:bug: Bug Fixes & Improvements

  • Light State Logic: Fixed an issue where lights would turn off completely instead of reverting to low beams when releasing the key.
  • Network Safety: Improved ensureNetworkId validation to prevent errors with non-networked vehicles.
  • Config: Added new configuration options for all new features.