Skip to content

Lt Notify

See Lt Notify in the store →

Resource: lt-notify. Free. Protected with Asset Escrow; config.lua, locales/ and client/compat.lua stay open.

Languages: English (default), Spanish, German and French. Chosen in Config.Locale; 'auto' follows your base locale.

Requirements

None. Works standalone and with qs-core, QBCore, Qbox, ESX and ox_lib.

Installation

  1. Download the script from Keymaster → Granted Assets with the Cfx.re account that claimed it.
  2. Copy the lt-notify folder into resources/.
  3. Add it to server.cfg:
ensure lt-notify

To make your other scripts use Lt Notify, see Replacing your framework's notifications.

Player menu

With /notify, each player picks a preset position or drags notifications anywhere on screen, and chooses the sound for each type from the ones the server offers, with its volume or muted. It is saved on their own client.

The command is changed or disabled in Config.Command (false removes it). To stop players moving notifications: Config.AllowPlayerMove = false.

Sending notifications

From the client

exports['lt-notify']:Notify({ type = 'success', title = 'Bank', message = 'You received **$500**' })
exports['lt-notify']:Notify('Simple message', 'error', 5000) -- short form

From the server

exports['lt-notify']:Notify(source, { type = 'info', message = 'Hello' })
exports['lt-notify']:Notify(-1, { type = 'announce', title = 'Server', message = 'Restart in 10 min' })
exports['lt-notify']:NotifyMany({ 1, 2, 3 }, 'Notice for several players', 'warning')
FieldPurpose
typeNotification type (see below)
titleOptional title
message / descriptionText
durationDuration in ms
iconIcon from web/js/icons.js
colorHex colour
soundKey of Config.Sounds, or false for none
idDoes not repeat the notification while visible (like ox_lib)

Types: success, error, info, warning, police, ems and announce. It also accepts other scripts' names: inform, primary, danger, warn, ambulance…

Allowed formatting: colours ~r~ ~g~ ~b~ ~y~ ~p~ ~o~ ~c~ ~w~, ~s~ (reset), ~n~ (line break) and **bold**. Text is never parsed as HTML, so nobody can inject code.

Replacing your framework's notifications

Make your framework call Lt Notify and do not enable Config.Compat, or every notification will show twice.

  • qs-core (client/main.lua, event qs:client:notify), first line of the handler. qs-core's QBCore and ESX bridges go through it too:
if GetResourceState('lt-notify') == 'started' then
    return exports['lt-notify']:Notify({ message = message, type = nType, duration = duration, title = title })
end
  • QBCore / Qbox: inside QBCore.Functions.Notify → exports['lt-notify']:Notify(text, texttype, length)
  • ESX: inside ESX.ShowNotification → exports['lt-notify']:Notify(message, notifyType, length)
  • ox_lib: inside lib.notify → exports['lt-notify']:Notify(data)

If you'd rather not touch the framework, Config.Compat listens to its network events (qs, qbcore, esx, oxlib), but the original notification will still show too.

Sounds

Only the server adds sounds; players choose among them in /notify. In Config.Sounds each sound can be:

  • synth: built-in tone, no file (chime, pop, soft, buzz, alert, bell).
  • game: GTA sound, { name, set }.
  • file: your own file in web/sounds/ (ogg, mp3 or wav).

To add your own: copy the file to web/sounds/, add it to Config.Sounds (my_sound = { label = 'My sound', file = 'my_sound.ogg' }) and assign it to a type in Config.Types, or let players pick it.

Configuration

OptionPurpose
Config.PositionsPreset positions in % of the screen. Tweak the numbers without creating a new one
Config.DefaultPositionServer default position (bottom-center)
Config.DefaultDurationDefault duration (5000 ms)
Config.MaxVisibleMaximum at once (5); the rest wait in a queue, announcements first
Config.GroupDuplicatesGroups repeated notices into one card with ×2, ×3…
Config.MaxTitleLength / Config.MaxMessageLengthMaximum title (60) and text (300) length
Config.TypesColour, icon, sound and duration of each type. You can add your own
Config.TypeAliasesAlternative names other scripts use
Config.DefaultVolumeStarting volume (0.0 – 1.0)

Troubleshooting

Every notification shows twice

You enabled Config.Compat for a framework that already calls Lt Notify, or the original notification is still active. Use only one of the two ways in Replacing your framework's notifications.

My scripts still use the old notifications

Lt Notify does not replace them on its own: redirect your framework's notify as explained in this section.

A custom sound does not play

Check the file is in web/sounds/, the name matches Config.Sounds, and the player has not muted it in /notify.

Escrow errors (entitlement, verify, parsing)

See the general FAQ.

Support

Still stuck? Open a ticket on our Discord with the script version, your framework and the full console error.