Overview
Native Scripts is a cross-framework script ecosystem for FiveM and RedM (RDR3) servers. The goal: a single codebase that runs unchanged on VORP, RSG-Core, RedEM:RP, ESX and QBCore.
Core component: ns-lib
Every script depends on the ns-lib resource. On startup the bridge auto-detects which framework, inventory system and SQL driver are running and loads the matching adapter. Script code only ever calls NSLib.X(...):
NSLib.OnPlayerLoaded(function(source, player)
-- player.identifier, .money.cash, .job.name — framework-agnostic
end)
if NSLib.HasItem(source, 'shovel', 1) then
NSLib.AddItem(source, 'grape', 5)
NSLib.Notify(source, 'You harvested 5 grapes', 'success')
end
You never need to know which framework is running.
Server setup
- Download ns-lib (free) from Tebex: nativescripts.com/package/7428342
- Get any ns-* script from the nativescripts.com catalog
- Drop both into your
resources/folder - Add them to
server.cfgin order (ns-lib first):ensure ns-lib ensure ns-vineyard - Apply the SQL and item registrations from each script's README
- Restart the server — you should see in the console:
[ns-lib] v1.0.0 initialized [ns-lib] framework=vorp | inventory=vorp | sql=oxmysql [ns-lib] adapters loaded ✓
Next
- Bridge architecture → — adapter pattern, API surface, runtime detection
- Conventions → — code style, folder structure, namespace model
- Scripts → — detailed documentation for each script