Exports ​
Client ​
client
| Export | Returns | Description |
|---|---|---|
Notify(data) / Notify(title, message?, type?, duration?) |
toast id | Show or update a toast. See Notifications |
DismissNotify(id) |
Remove a toast | |
ClearNotify() |
Remove all toasts | |
ShowPrompt(prompt) |
Show or replace an interaction prompt | |
HidePrompt(id?) |
Hide one prompt, or all prompts | |
Progress(data) |
boolean |
Blocking. true = finished, false = cancelled. See Progress bars |
CancelProgress() |
boolean |
Cancel the running bar |
IsProgressActive() |
boolean |
|
SetTheme(brand?, strength?) |
'#4f7bff', 'accent' | 'tiles' | 'glass'. nil → neutral |
|
SetVisible(visible) |
Hide or show the whole HUD (cutscenes, other UIs) | |
IsVisible() |
boolean |
|
ClaimZones(zones, tag?) |
boolean |
Hide the zones another UI covers: { 'top-right', ... }, 'all' or false to release. See Sharing the screen |
GetClaimedZones() |
string[] |
Zones claimed right now |
SetSeatbelt(on) |
Also sets LocalPlayer.state.seatbelt |
|
GetSeatbelt() |
boolean |
lua
local id = exports.np_hud:Notify('Saved', 'Your outfit was saved.', 'success', 3000)
exports.np_hud:SetTheme('#4f7bff', 'tiles')
exports.np_hud:SetVisible(false)
exports.np_hud:ClaimZones({ 'top-right', 'bottom-right' })
exports.np_hud:SetSeatbelt(true)
Server ​
server
| Export | Description |
|---|---|
Notify(source, data, onAction?) |
Toast for one player. onAction(player, action, id) runs after validation |
NotifyAll(data, onAction?) |
Toast for everyone |
Announce(data) |
Top-centre announce toast for everyone |
lua
exports.np_hud:Notify(source, { title = 'Paycheck', message = 'You received **$450**.', type = 'success', icon = 'money-bill' })
exports.np_hud:NotifyAll({ title = 'Weather', message = 'A storm is coming.', icon = 'cloud-bolt' })
exports.np_hud:Announce({ title = 'Server restart', message = 'Restart in **15 minutes**.', tint = 'red' })
Server toast ids start with sv:, client toast ids with cl:, and generated progress ids with pg:.