Triggers and Exports
Some functions you can have other scripts use in the HUD.
DISPLAY
1. Display
Controls the visibility of the HUD.
Passing false
hides the HUD, while true
shows it.
-- Hide the HUD
exports['neon-hud']:Display(false)
-- Show the HUD
exports['neon-hud']:Display(true)
2. GetDisplayState
Returns whether the HUD is currently visible or hidden.
-- Get current HUD visibility state (true = visible, false = hidden)
local isVisible = exports['neon-hud']:GetDisplayState()
print("HUD is visible:", isVisible)
3. GetDisplayInfo
Provides detailed information about the current HUD status.
-- Get detailed HUD status
local displayInfo = exports['neon-hud']:GetDisplayInfo()
print("HUD visible:", displayInfo.visible)
print("HUD hidden:", displayInfo.hidden)
print("Cinematic mode:", displayInfo.cinematic)
print("Pause menu active:", displayInfo.paused)
📢 Events
neon-hud:displayStateChanged
This event is triggered whenever the HUD display state changes.
rfer-- Listen for HUD visibility changes
RegisterNetEvent('neon-hud:displayStateChanged', function(isVisible)
if isVisible then
print("HUD has been shown")
else
print("HUD has been hidden")
end
end)
STRESS
These functions are to be called from any script and will do things to stress of the players. For example, if you want an ITEM to reduce stress...
Reset stress completely:
neon-hud:resetStress
Reduce any amount of stress you want:
neon-hud:removeStress, value
Increase the amount of stress as much as you want.:
neon-hud:addStress, value
Example:
local stressReduction = 20
TriggerEvent('neon-hud:removeStress', stressReduction)
Last updated