Overview
Native Scripts (FiveM) is a framework-agnostic script collection for FiveM (GTA5) servers. The goal: a single codebase that runs unchanged on ESX, QBCore, Qbox (qbx_core), vRP 1.x and standalone.
Core layer: ns-utils
Unlike the RedM side (which uses a shared ns-lib resource), FiveM scripts use ns-utils — a self-contained utils/ folder copied into each resource. There is no shared dependency to install. On startup it auto-detects the framework, inventory, target, skin and SQL systems and exposes a single Utils.* API:
Utils.OnPlayerLoaded(function(src)
local player = Utils.GetPlayer(src) -- framework-agnostic
end)
if Utils.HasItem(src, 'water', 1) then
Utils.RemoveItem(src, 'water', 1)
Utils.AddMoney(src, 'cash', 10, 'water_sale')
Utils.Notify(src, '+$10 (water sold)', 'success')
end
You never branch on the framework name — all of that lives inside utils/.
Server setup
- Get any ns-* FiveM script from the nativescripts.com catalog
- Drop it into your
resources/folder - Add it to
server.cfg:ensure ns-loadingscreen - Apply the SQL and item registrations from the script's README (if any)
- Restart — the console prints the detected stack:
[ns-loadingscreen][INFO] shared.lua ready (framework=qbx, inv=ox_inventory, target=ox_target, skin=illenium-appearance, sql=oxmysql)
Optional dependencies
- ox_lib — if present,
Utils.Notifyroutes through it for nicer notifications. Otherwise it falls back to the framework-native notify. - oxmysql — required only for scripts that use a database (
Utils.ExecuteSql).
Detection priority
| Category | Priority (first match wins) |
|---|---|
| Framework | qbx_core → qb-core → es_extended → vRP (vrp / vRP / vrpex / vrp_ex) → standalone |
| Inventory | ox_inventory → qb-inventory → qs-inventory → codem-inventory → ps-inventory → esx_inventoryhud → gfx-inventory → vRP built-in |
| Target | ox_target → qb-target → qtarget |
| Skin | illenium-appearance → fivem-appearance → qb-clothing → esx_skin → skinchanger |
| SQL | oxmysql → ghmattimysql → mysql-async |
Renamed cores can be pointed at explicitly with convars:
setr ns_framework "vrp" # qbx | qb | esx | vrp | standalone
setr ns_framework_resource "vrpex" # vRP only: the actual folder name
vRP 1.x
vRP publishes no exports, so the layer speaks its Proxy event protocol directly —
money, inventory, jobs (groups of type job), permissions, identity and the
vRP:playerSpawn / vRP:playerLeave lifecycle all map onto the same Utils.*
API. Nothing is added to any fxmanifest.lua, so the same build still starts on
a non-vRP server. vRP inventory items are defined at runtime, so there is no
items.lua entry to add.
Next
- Scripts → — documentation for each FiveM script