Upgrading from Default ox_lib
By default, the Nexus UI Pack acts as a wrapper that styles standard ox_lib calls (such as progress bars, dialogs, and notifications) into a modern glass-morphic theme. You have two options for applying this look across your server’s resources.
Global Injection (Recommended)
Rather than editing the configuration or manifests of every single script on your server, you can hook the Nexus UI Pack centrally. This is the fastest setup method and automatically updates all resources utilizing ox_lib.
Open the init.lua file inside your ox_lib resource folder and append the following code snippet at the very end of the file:
local NXS_RESOURCE <const> = "nxs_ui"
if GetResourceState(NXS_RESOURCE) == "missing" then return end
local success, err = pcall(function()
local code = LoadResourceFile(NXS_RESOURCE, "init.lua")
if code then
load(code)()
end
end)
if not success then
error(("Failed to load nxs_ui. Error: %s"):format(err))
endKey Advantages
- Server-Wide Style Upgrade: Instantly upgrades all compatible script interfaces to the Nexus theme with zero manual edits.
- Fail-Safe Fallbacks: If the
nxs_uiresource is stopped or fails to load,ox_libimmediately falls back to its default appearance so that your server features never break. - Clean Updates: Upgrading scripts in the future won’t require you to re-add manifest overrides.
Per-Resource Injection (Alternative)
If you only want certain scripts to utilize the Nexus UI theme instead of applying it server-wide, you can inject the wrapper individually.
To do this, add the @nxs_ui/init.lua export hook directly under @ox_lib/init.lua inside the target script’s fxmanifest.lua:
shared_scripts {
'@ox_lib/init.lua',
'@nxs_ui/init.lua' -- Nexus UI wrapper injection
}If you use this per-resource injection method, do not add @nxs_ui/init.lua to ox_lib’s own fxmanifest.lua. It should only be imported inside the specific resources you wish to upgrade.