hz_lib
Overview
hz_lib is the shared foundation used by all Hz-Scripts resources. It automatically detects your server environment and provides a unified API so that every Hz-Script works out of the box, regardless of your framework or addon combination.Free asset — hz_lib is available for free on the Hz-Scripts shop. Download it once and all compatible scripts will use it automatically.
What does it do?
Instead of each script including its own framework detection and adapter code, hz_lib handles it centrally:
| Module | What it detects |
|---|---|
| Framework | ESX, QBCore, QBox, Ox Core, vRP, Standalone |
| Inventory | ox\_inventory, hz\_inventory, qs-inventory, ps-inventory, codem, core, origen, tgiann, ak47, qb-inventory, framework |
| Notifications | ox\_lib, okokNotify, mythic\_notify, codem, pNotify, framework, GTA native |
| Target | ox\_target, qb-target, interact, built-in TextUI |
| Menu / UI | ox\_lib (full), qb-menu + qb-input, ESX menu, GTA native fallback |
| Dispatch | cd\_dispatch, ps-dispatch, qs-dispatch, rcore\_dispatch, emergencydispatch, built-in |
| Banking / Society | hz\_banking, qb-banking, qb-management, Renewed-Banking, okokBanking, qs-banking, tgg-banking, crm-banking, tgiann-bank, esx\_society |
| Callbacks | Bidirectional (client-server) with rate limiting & timeout |
| Minigames | Progress bar, skill check, sequence |
/hzpanel) — every HZ-Script module declares its config schema, and the panel auto-builds a typed in-game editor so you tweak everything without touching files or restarting. See Admin Panel.
On top of that, hz_lib draws two on-screen elements shared by every HZ script: an NPC dialogue box (the NPC's line types out in time with its voice, then up to four choices) and an objectives tracker for jobs and missions. See NPC Dialogue and Objectives Tracker.
Key Benefits
- Install once — All Hz-Scripts share the same bridge, no duplicate code
- Auto-detection — Leave everything on
'auto'and hz_lib figures out your setup - Override when needed — Force a specific system in one config file
- 140+ exports — Use the bridge from your own scripts too
- Centralised admin UI —
/hzpanelopens one panel for every HZ-Script module (more) - Unified theme — change accent, surfaces, radius scale in one place, every HZ NUI retints live
- Zero performance cost — Detection runs once at startup, exports are instant
Supported Systems
Frameworks
| Framework | Resource | Status |
|---|---|---|
| ESX | es_extended | Full |
| QBCore | qb-core | Full |
| QBox | qbx_core | Full |
| Ox Core | ox_core | Full |
| vRP | vRP | Full |
| Standalone | — | Full |
Inventories
| Inventory | Resource | Status |
|---|---|---|
| ox\_inventory | ox_inventory | Full |
| qs-inventory | qs-inventory | Full |
| ps-inventory | ps-inventory | Full |
| codem-inventory | codem-inventory | Full |
| core\_inventory | core_inventory | Full |
| origen\_inventory | origen_inventory | Full |
| tgiann-inventory | tgiann-inventory | Full |
| ak47\_inventory | ak47_inventory | Full |
| qb-inventory | qb-inventory | Full |
| hz\_inventory | hz_inventory | Full (ox\_inventory adapter) |
| Framework native | — | Basic |
Menu Systems
| Menu System | Resource | Features |
|---|---|---|
| ox\_lib | ox_lib | Context, Input, Alert, TextUI, Progress, List menu |
| qb-menu | qb-menu | Context, Input (via qb-input), TextUI (via qb-core) |
| ESX menu | esx_menu_default | Context, List menu, TextUI (via esx\_textui) |
| Native | — | GTA keyboard input, help text, basic fallback |
Quick Start
- Download hz_lib from the shop (free)
- Place it in your
resources/folder - Add
ensure hz_libto yourserver.cfgbefore any Hz-Script - Done — all Hz-Scripts will auto-detect it
For Developers
hz_lib exposes 140+ exports that you can use from your own scripts:
-- Framework
local job = exports['hz_lib']:GetPlayerJob()
-- Notifications
exports['hz_lib']:Notify('Hello!', 'success', 3000)
-- Inventory (server)
exports['hz_lib']:AddItem(source, 'bread', 5)
-- Menu (client)
exports['hz_lib']:ContextMenu('my_menu', 'My Menu', {
{ title = 'Option 1', onSelect = function() print('selected') end },
})
-- Callbacks
exports['hz_lib']:RegisterCallback('myResource:getData', function(source)
return { money = 1000 }
end)
See the full Exports & API reference.
