Replace Notifications
This guide shows you how to replace your framework’s default notification system with ARS Hud V3 notifications. After making this change, every script on your server that uses the framework’s standard notify function (banking, MDT, inventory, garage, etc.) will automatically display notifications through the HUD.
Table of Contents
Section titled “Table of Contents”- How It Works
- QBCore Replacement
- QBX (Qbox) Replacement
- ESX Replacement
- Server-Side Notes
- Type Mapping
- Verification
- Troubleshooting
1. How It Works
Section titled “1. How It Works”Most FiveM scripts call a single framework function to show notifications:
- QBCore —
QBCore.Functions.Notify(text, type, duration)on the client, which also gets triggered by theQBCore:Notifyevent from the server - QBX (Qbox) —
exports.qbx_core:Notify(text, type, duration)on the client, which delegates toox_lib’slib.notify(). Also backwards-compatible withQBCore.Functions.Notifyvia a bridge - ESX —
ESX.ShowNotification(message, type, duration, title)on the client, which also gets triggered by theesx:showNotificationevent from the server
By replacing this single function inside your framework, every script that calls it will route notifications through ARS Hud V3 instead. No per-script changes are needed.
Important: This modifies your framework’s source files. Back up the files before making changes. After updating your framework, you will need to re-apply these changes.
2. QBCore Replacement
Section titled “2. QBCore Replacement”Step 1: Open the file
Section titled “Step 1: Open the file”Open qb-core/client/functions.lua in your qb-core resource.
Step 2: Find the Notify function
Section titled “Step 2: Find the Notify function”Search for function QBCore.Functions.Notify. The default implementation looks like this:
function QBCore.Functions.Notify(text, texttype, length, icon) local message = { action = 'notify', type = texttype or 'primary', length = length or 5000, } if type(text) == 'table' then message.text = text.text or 'Placeholder' message.caption = text.caption or 'Placeholder' else message.text = text end if icon then message.icon = icon end SendNUIMessage(message)endStep 3: Replace the function body
Section titled “Step 3: Replace the function body”Replace the entire function with the following:
function QBCore.Functions.Notify(text, texttype, length, icon) local title = '' local message = ''
if type(text) == 'table' then title = text.caption or '' message = text.text or '' else message = tostring(text) end
local notifyType = 'default' if texttype == 'primary' then notifyType = 'default' elseif texttype == 'error' then notifyType = 'error' elseif texttype == 'success' then notifyType = 'success' elseif texttype == 'inform' or texttype == 'police' or texttype == 'ambulance' then notifyType = 'inform' elseif texttype == 'warning' then notifyType = 'warning' end
exports['ars_hud']:Notify(title, message, notifyType, length or 5000)endStep 4: Save and restart
Section titled “Step 4: Save and restart”Save the file, then restart qb-core and ars_hud in your server console:
restart qb-corerestart ars_hudTip: If your
qb-coreresource name is different (for exampleqb-core-custom), adjust the folder path accordingly.
3. QBX (Qbox) Replacement
Section titled “3. QBX (Qbox) Replacement”QBX uses ox_lib’s lib.notify() for all notifications. The Notify function is exported from qbx_core and handles parsing the title and description before passing them to lib.notify. Replacing this single function routes all QBX notifications through ARS Hud.
Note: QBX includes a QBCore backwards-compatibility bridge —
QBCore.Functions.Notify(...)callsexports.qbx_core:Notify(...)internally. Replacing the QBXNotifyfunction also catches scripts still using the QBCore syntax.
Step 1: Open the file
Section titled “Step 1: Open the file”Open qbx_core/client/functions.lua in your qbx_core resource.
Step 2: Find the Notify function
Section titled “Step 2: Find the Notify function”Search for function Notify(. The default implementation looks like this:
function Notify(text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor) local title, description if type(text) == 'table' then title = text.text or 'Placeholder' description = text.caption or nil elseif subTitle then title = text description = subTitle else description = text end local position = notifyPosition or positionConfig
lib.notify({ id = title, title = title, description = description, duration = duration, type = notifyType, position = position, style = notifyStyle, icon = notifyIcon, iconColor = notifyIconColor })end
exports('Notify', Notify)Step 3: Replace the function body
Section titled “Step 3: Replace the function body”Replace the function (keep the exports line at the bottom) with:
function Notify(text, notifyType, duration, subTitle, notifyPosition, notifyStyle, notifyIcon, notifyIconColor) local title = '' local description = ''
if type(text) == 'table' then title = text.text or '' description = text.caption or '' elseif subTitle then title = tostring(text) description = tostring(subTitle) else description = tostring(text) end
local arsType = 'default' if notifyType == 'inform' then arsType = 'inform' elseif notifyType == 'error' then arsType = 'error' elseif notifyType == 'success' then arsType = 'success' elseif notifyType == 'warning' then arsType = 'warning' end
exports['ars_hud']:Notify(title, description, arsType, duration or 5000)end
exports('Notify', Notify)Step 4: Save and restart
Section titled “Step 4: Save and restart”Save the file, then restart qbx_core and ars_hud in your server console:
restart qbx_corerestart ars_hudTip: If you also have the QBCore bridge enabled in QBX (
qbx_core/bridge/qb/), you do not need to edit it separately. The bridge callsexports.qbx_core:Notify(...)which routes through your replaced function.
4. ESX Replacement
Section titled “4. ESX Replacement”The steps differ slightly between modern ESX (which uses esx_notify) and legacy ESX (which uses GTA native help text).
Modern ESX (esx_notify)
Section titled “Modern ESX (esx_notify)”Step 1: Open the file
Section titled “Step 1: Open the file”Open esx_notify/client/main.lua in your esx_notify resource.
Step 2: Find the Notify export
Section titled “Step 2: Find the Notify export”Search for the Notify function that handles displaying notifications. The default implementation uses its own NUI system.
Step 3: Replace the function
Section titled “Step 3: Replace the function”Replace the Notify export function body with:
function Notify(type, length, message, title, position) local notifyType = 'default' if type == 'info' then notifyType = 'inform' elseif type == 'error' then notifyType = 'error' elseif type == 'success' then notifyType = 'success' elseif type == 'warning' then notifyType = 'warning' end
exports['ars_hud']:Notify(title or '', message or '', notifyType, length or 5000)endStep 4: Save and restart
Section titled “Step 4: Save and restart”restart es_extendedrestart esx_notifyrestart ars_hudLegacy ESX (no esx_notify)
Section titled “Legacy ESX (no esx_notify)”Step 1: Open the file
Section titled “Step 1: Open the file”Open es_extended/client/functions.lua in your es_extended resource.
Step 2: Find ShowNotification
Section titled “Step 2: Find ShowNotification”Search for function ESX.ShowNotification. The default implementation uses GTA native help text:
ESX.ShowNotification = function(msg, flash, saveToBrief, hudColorIndex) if saveToBrief == nil then saveToBrief = true end AddTextEntry('esxNotification', msg) BeginTextCommandThefeedPost('esxNotification') if hudColorIndex then ThefeedNextPostBackgroundColor(hudColorIndex) end EndTextCommandThefeedPostTicker(flash or false, saveToBrief)endStep 3: Replace the function
Section titled “Step 3: Replace the function”Replace the function with:
ESX.ShowNotification = function(msg, flash, saveToBrief, hudColorIndex) exports['ars_hud']:Notify('', tostring(msg), 'default', 5000)endStep 4: Save and restart
Section titled “Step 4: Save and restart”restart es_extendedrestart ars_hud5. Server-Side Notes
Section titled “5. Server-Side Notes”You do not need to change server-side code. Here is why:
QBCore server-side
Section titled “QBCore server-side”Server scripts call QBCore.Functions.Notify(source, text, type, length), which triggers TriggerClientEvent('QBCore:Notify', source, text, type, length). On the client, this event calls QBCore.Functions.Notify(text, type, length). Since you replaced the client-side function, server-triggered notifications are caught automatically.
QBX server-side
Section titled “QBX server-side”Server scripts call exports.qbx_core:Notify(source, text, type, duration, ...) which triggers TriggerClientEvent('ox_lib:notify', source, ...). Since you replaced the client-side Notify function (which is what receives the forwarded notification), both direct client calls and server-triggered calls route through ARS Hud. Alternatively, you can also edit qbx_core/server/functions.lua to replace the server-side Notify function if you want to change the routing on the server side as well.
ESX server-side
Section titled “ESX server-side”Server scripts call xPlayer.showNotification(message) or TriggerClientEvent('esx:showNotification', source, message). Both end up calling ESX.ShowNotification on the client. Since you replaced that function, server-triggered notifications are caught automatically.
6. Type Mapping
Section titled “6. Type Mapping”QBCore to ARS Hud
Section titled “QBCore to ARS Hud”| QBCore Type | ARS Hud Type | Description |
|---|---|---|
'primary' |
'default' |
Default informational notification |
'error' |
'error' |
Error or failure notification |
'success' |
'success' |
Success notification |
'inform' |
'inform' |
Informational notification |
'police' |
'inform' |
Police notification |
'ambulance' |
'inform' |
EMS notification |
'warning' |
'warning' |
Warning notification |
QBX (ox_lib types) to ARS Hud
Section titled “QBX (ox_lib types) to ARS Hud”| QBX / ox_lib Type | ARS Hud Type | Description |
|---|---|---|
'inform' |
'inform' |
Informational notification |
'error' |
'error' |
Error notification |
'success' |
'success' |
Success notification |
'warning' |
'warning' |
Warning notification |
ESX (esx_notify) to ARS Hud
Section titled “ESX (esx_notify) to ARS Hud”| ESX Type | ARS Hud Type | Description |
|---|---|---|
'info' |
'inform' |
Informational notification |
'error' |
'error' |
Error notification |
'success' |
'success' |
Success notification |
'warning' |
'warning' |
Warning notification |
7. Verification
Section titled “7. Verification”After making the changes and restarting your server:
- Join with a character and verify the HUD loads normally
- Trigger a notification from any script that uses the framework’s notify system (for example, use an ATM, open your inventory, or receive a salary payment)
- Confirm the notification appears in the ARS Hud notification style instead of the default GTA-style notification or old framework style
- Test different notification types by running a script that sends
error,success, andinformtypes
Quick test commands
Section titled “Quick test commands”You can test directly from your server console or chat:
QBCore test (run in client console or add to a temporary script):
QBCore.Functions.Notify('Test default', 'primary', 5000)QBCore.Functions.Notify('Test success', 'success', 5000)QBCore.Functions.Notify('Test error', 'error', 5000)QBX test (run in client console or add to a temporary script):
exports.qbx_core:Notify('Test inform', 'inform', 5000)exports.qbx_core:Notify('Test success', 'success', 5000)exports.qbx_core:Notify('Test error', 'error', 5000)ESX test (run in client console or add to a temporary script):
ESX.ShowNotification('Test notification from ESX')8. Troubleshooting
Section titled “8. Troubleshooting”Notifications still show the old style
Section titled “Notifications still show the old style”- Verify you saved the file after editing
- Restart both the framework resource and
ars_hudin your server console - Check that
ars_hudis running before you test — runstatusin the server console and look for it in the resource list - Make sure no other notification replacement script (such as
okokNotify,cd_notifications, oresx_notifyin some setups) is overriding the function after your change
Notifications do not show at all
Section titled “Notifications do not show at all”- Confirm
ars_hudis started and the HUD is visible on screen - Check the client console (F8) for errors related to
ars_hudor the framework - Verify the
Notifyexport works by calling it directly:exports['ars_hud']:Notify('Test', 'Direct export test', 'success', 5000)
Framework errors after the change
Section titled “Framework errors after the change”- Make sure you replaced the function body only, not the function signature — the function name and parameters must stay the same
- Check for Lua syntax errors (missing
end, unbalanced parentheses, etc.) - Restore the backup file if needed and try again
Changes lost after framework update
Section titled “Changes lost after framework update”- Framework updates overwrite your changes. Keep a backup of your modified file
- Re-apply the changes after every framework update
- Some frameworks support custom code injection via modules or plugins — check your framework’s documentation for a less intrusive approach
Note: This guide is written by a third party. If you find any incorrect or outdated information, please contact us on Discord so we can update it for you.