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:

ModuleWhat it detects
FrameworkESX, QBCore, QBox, Ox Core, vRP, Standalone
Inventoryox\_inventory, hz\_inventory, qs-inventory, ps-inventory, codem, core, origen, tgiann, ak47, qb-inventory, framework
Notificationsox\_lib, okokNotify, mythic\_notify, codem, pNotify, framework, GTA native
Targetox\_target, qb-target, interact, built-in TextUI
Menu / UIox\_lib (full), qb-menu + qb-input, ESX menu, GTA native fallback
Dispatchcd\_dispatch, ps-dispatch, qs-dispatch, rcore\_dispatch, emergencydispatch, built-in
Banking / Societyhz\_banking, qb-banking, qb-management, Renewed-Banking, okokBanking, qs-banking, tgg-banking, crm-banking, tgiann-bank, esx\_society
CallbacksBidirectional (client-server) with rate limiting & timeout
MinigamesProgress bar, skill check, sequence
It also ships a centralised admin panel (/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 — /hzpanel opens 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

FrameworkResourceStatus
ESXes_extendedFull
QBCoreqb-coreFull
QBoxqbx_coreFull
Ox Coreox_coreFull
vRPvRPFull
Standalone—Full

Inventories

InventoryResourceStatus
ox\_inventoryox_inventoryFull
qs-inventoryqs-inventoryFull
ps-inventoryps-inventoryFull
codem-inventorycodem-inventoryFull
core\_inventorycore_inventoryFull
origen\_inventoryorigen_inventoryFull
tgiann-inventorytgiann-inventoryFull
ak47\_inventoryak47_inventoryFull
qb-inventoryqb-inventoryFull
hz\_inventoryhz_inventoryFull (ox\_inventory adapter)
Framework native—Basic
Menu SystemResourceFeatures
ox\_libox_libContext, Input, Alert, TextUI, Progress, List menu
qb-menuqb-menuContext, Input (via qb-input), TextUI (via qb-core)
ESX menuesx_menu_defaultContext, List menu, TextUI (via esx\_textui)
Native—GTA keyboard input, help text, basic fallback

Quick Start

  1. Download hz_lib from the shop (free)
  2. Place it in your resources/ folder
  3. Add ensure hz_lib to your server.cfg before any Hz-Script
  4. Done — all Hz-Scripts will auto-detect it
See the Installation guide for full details.

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.