Client
The ak47_hud provides a robust, developer-friendly export API. These client-side exports allow server owners and other script developers to seamlessly interact with the HUD, toggle its features, and dynamically manage systems like stress, seatbelts, and the police radar without modifying the core code.
Note: All functions below are Client-Side exports. You call them using
exports['ak47_hud']:FunctionName().
🖥️ Core HUD API
These exports allow you to control the visibility of the HUD and its individual elements.
ToggleHudElement
Dynamically shows or hides specific elements of the HUD.
Parameter
Type
Description
element
string
The ID of the HUD element.
state
boolean
true to show, false to hide.
Valid Elements: money, status, compass, location, vehicle, crosshair, party, killfeed, chat, notification, serverinfo, minimap, all.
-- Hide just the minimap
exports['ak47_hud']:ToggleHudElement('minimap', false)
-- Hide the entire HUD completely
exports['ak47_hud']:ToggleHudElement('all', false)GetHudState
Returns the current visibility state of a specific HUD element.
Parameter
Type
Description
element
string
The ID of the HUD element (same as above, plus cinematic).
SetCinematicMode
Forces cinematic mode (black bars) on or off. Hides conflicting HUD elements automatically.
Parameter
Type
Description
state
boolean
true to enable cinematic bars, false to disable.
Notify
Triggers the built-in custom notification system.
Parameter
Type
Description
message
string
The text of the notification.
type
string
default, info, success, warning, error.
duration
number
Time in milliseconds (e.g., 5000).
title
string
(Optional) Custom title text.
🏎️ Seatbelt System API
Manage the seatbelt system, ejection logic, and vehicle whitelists dynamically.
ToggleSeatbeltSystem
Enables or disables the entire seatbelt and ejection physics system. Useful for minigames or admin modes.
Parameter
Type
Description
state
boolean
true to enable, false to disable.
SetSeatbelt
Programmatically buckle or unbuckle the local player.
Parameter
Type
Description
state
boolean
true to buckle up, false to unbuckle.
HasSeatbeltOn & GetSeatbeltSystemState
Getter functions to check the status of the seatbelt.
AddToSeatbeltWhitelist & RemoveFromSeatbeltWhitelist
Dynamically allow specific vehicle classes or models to bypass the seatbelt requirement (no ejection/no seatbelt logic).
Parameter
Type
Description
whitelistType
string
"class" or "model".
value
string/number
Class ID (e.g., 18) or model name (e.g., "adder").
😰 Stress System API
Control stress behaviors, disable certain stress triggers, or whitelist jobs/vehicles on the fly.
ToggleStressSystem
Toggles specific parts of the stress system on or off.
Parameter
Type
Description
system
string
"vehicle", "shooting", "melee", "effects", or "all".
state
boolean
true to enable, false to disable.
GetStressSystemState
Returns the boolean state of a specific stress sub-system.
Parameter
Type
Description
system
string
"vehicle", "shooting", "melee", or "effects".
AddToStressBypass & RemoveFromStressBypass
Dynamically exempt specific jobs, vehicles, vehicle classes, or weapons from generating stress.
Parameter
Type
Description
bypassType
string
"job", "vehicle", "class", or "weapon".
value
string/number
The identifier (e.g., "ambulance", "WEAPON_STUNGUN", etc.)
🚓 Police Radar API
Integrate the police radar with radial menus, dispatch systems, or external keybind managers.
OpenRadarUI
Opens the Police Radar remote control UI programmatically. Bypasses the /radar command.
SetRadarPower
Turns the radar tracking on or off.
Parameter
Type
Description
state
boolean
true to turn on, false to turn off.
GetRadarData
Fetches the live, real-time data currently captured by the radar's antennas.
Returns a table: { patrolSpeed = number, front = table, rear = table }
SetRadarLock
Locks or unlocks a specific antenna to hold a speed reading.
Parameter
Type
Description
direction
string
"front" or "rear".
state
boolean
true to lock, false to unlock.
ClearRadarFast
Clears the saved "Fastest Speed" memory for the antennas.
Parameter
Type
Description
direction
string
"front", "rear", or "all".
GetRadarState
Gets the current power status and configuration settings of the radar.
Returns a table: { power = boolean, settings = table }
Last updated