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.
Changelog
V1.1
Changelog
v1.1.0 (Performance & Immersion Update)
Released: 2025-12-04
New Features
- OneSync Infinity Support: Added
Config.UseOneSyncto 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 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
ensureNetworkIdvalidation to prevent errors with non-networked vehicles. - Config: Added new configuration options for all new features.
Core Features
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.
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).
Audio Feedback (New): A subtle, realistic “click” sound plays when toggling the lever, adding to the immersion.
Anti-Spam Protection (New): Includes a configurable cooldown to prevent players from spamming the key and flooding the network.
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.
Hold-to-Flash: The high beams remain active only while the key is held down, mimicking real-life behavior.
Driver-Only Mode: Configurable option to restrict usage to the driver’s seat only.
Broken Headlight Check: Realistic safety check that prevents usage if the vehicle’s headlights are damaged.
Custom Keybind: Uses FiveM’s RegisterKeyMapping, allowing every player to customize the key (Default: K) in their own GTA settings.
Highly Optimized: Lightweight code structure with virtually 0.00ms idle usage and efficient network traffic management.
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 |


