All resources

rsg-npcs – Developer Docs#

Overview#

Client-side, config-driven ambient NPC spawner. No database, no server events, no ox_lib.

Files#

FilePurpose
fxmanifest.luaManifest; depends on rsg-core only
shared/config.luaConfig.Debug, Config.DistanceSpawn, Config.FadeIn, Config.PedList
client/client.luaDistance loop, spawn/despawn with fade, scenarios, blips, xsound audio, cleanup on stop
server/versionchecker.luaGitHub version check
sounds/Local audio (nui://rsg-npcs/sounds/<file>)

Framework usage#

  • exports['rsg-core']:GetCoreObject() – core object
  • RSGCore.Functions.RequestModel(model) – model loading (replaces lib.requestModel)
  • PlayerPedId() – replaces cache.ped

ox_lib migration (v3.0.1)#

BeforeAfter
@ox_lib/init.lua in shared_scriptsremoved
dependencies { 'ox_lib' }dependencies { 'rsg-core' }
lib.requestModel(model, 10000)RSGCore.Functions.RequestModel(model)
cache.pedPlayerPedId()

No locales are used (no player-facing text), so @rsg-core/shared/locale.lua is not needed.

Optional#

  • xsound – proximity audio; detected via GetResourceState('xsound'), skipped silently if missing.
<!-- BEGIN AUTO-REFERENCE (generated from the code; re-run the generator instead of editing by hand) -->

Technical reference#

Generated from the source of rsg-npcs 3.0.1. Names, arguments and defaults below are read straight from the code.

Dependencies#

rsg-core

Configuration#

OptionDefaultNotes
Config.Debugfalse
Config.DistanceSpawn20.0Distance before spawning/despawning the ped. (GTA Units.)
Config.FadeIntrue
Config.PedListtable
<!-- END AUTO-REFERENCE -->