Skip to Content
OLS HUDClientClient exports and events

Client exports and events

This page is for scripters who call OLS HUD from other client Lua resources. Names and argument order come from configs/main.luaapi. If you rename or disable an entry, use your configured names instead of the defaults below.

Calling style

  • Positional arguments — order matches params in config (e.g. type, title, message, duration for notify).
  • Table argument — pass one table with named keys; the HUD maps them regardless of order.
exports.ols_hud:notify("success", "Title", "Message", 5000) exports.ols_hud:notify({ type = "success", title = "Title", message = "Message", duration = 5000 })

Events use the same payloads. Register with AddEventHandler for local use; from the server, use TriggerClientEvent with the configured event name.


Notifications (default: notify / ols_hud:notify)

FieldTypeDefaultDescription
typestring"info"info, warning, error, success
titlestring""Title
messagestring""Body
durationnumber5000Milliseconds

Announcements (default: announce / ols_hud:announce)

Client-side call shows the banner locally. For everyone, use the server export or TriggerClientEvent to -1 — see Server exports.

FieldTypeDefaultDescription
titlestring""Title
descriptionstring""Body
durationnumber10000Milliseconds

Help notify (default: helpNotify / hideHelpNotify)

Export / eventParametersDescription
helpNotifytext, keyShows the key hint (e.g. “Press E …”, key E).
hideHelpNotifynoneHides the hint.

If autoHideHelpNotify is on in config, the hint also clears after a short timeout.


Progress bar (default: progress / cancelProgress)

FieldTypeDefaultDescription
labelstring""Label
durationnumber5000Milliseconds
canCancelbooleanfalseAllow cancel (e.g. ESC)

The progress export is blocking: it returns true when finished, false if cancelled.

local success = exports.ols_hud:progress("Crafting...", 5000, true) if success then -- completed else -- cancelled end

cancelProgress forces an active bar to stop and resolves the wait as cancelled.


HUD visibility

NameTypeDescription
toggleHudexportexports.ols_hud:toggleHud(boolean)true show, false hide.
isHudVisibleexportReturns whether the HUD is shown (boolean).
ols_hud:toggleHudeventSame as export; can be triggered from server with TriggerClientEvent.

The NUI may start hidden until load completes; the resource shows the HUD when the player is loaded or the resource starts, unless something hides it.


Safezone

NameDescription
isInSafezoneExport: exports.ols_hud:isInSafezone()boolean.
ols_hud:safezoneChangedLocal event: AddEventHandler("ols_hud:safezoneChanged", function(state) end)state is true inside, false outside.

Config reference

Rename or disable integrations in configs/main.lua under api. Set export or event to false to turn off that path. See Main config for the full table.

Last updated on