Version 6.0.0 | 04-24-2026
CBK NPC CONTROLLER is an ambient-only AI and traffic policy resource for FiveM.
It controls peds and vehicles that already exist in the world. It does not spawn peds, vehicles, jobs, framework bridges, or population-zone systems. The server owns config state, admin permissions, and nearby traffic context; clients apply that policy to ambient entities they can control.
cbk-npc/
fxmanifest.lua
config.lua
shared/config.lua
server/
permissions.lua
config_sync.lua
npc_controller.lua
client/
density.lua
npc_manager.lua
traffic_controller.lua
- Controls pedestrian, traffic, parked-vehicle, and scenario density.
- Applies ambient ped behavior such as ignore, flee, panic, combat, and ragdoll settings.
- Applies ambient driver behavior such as driving style, traffic-light respect, indicator suppression, and player avoidance.
- Slows, bypasses, or pulls traffic over around emergency vehicles based on
Config.VehicleSettings.emergencyVehicleBehavior. - Suppresses specific scenario groups and animal classes.
- Applies server-owned command permissions and config synchronization.
- Broadcasts server-built pedestrian avoidance anchors for nearby players on foot.
- Emits local client events for entering a vehicle, exiting a vehicle, and nearby ambient NPC discovery.
- Ships with a grouped runtime panel that supports search, profiles, and server-validated live edits.
- No framework integration.
- No job-based NPC behavior.
- No managed spawning or spawn tickets.
- No server population zones or runtime governors.
- No scripted exports are provided by this resource.
The active config surface is in config.lua
Main sections:
Config.PopulationDensity: frame-level density multipliers plus ambient ped/traffic trim shaping.Config.SpawnControl: hard suppression for ambient peds, vehicles, parked vehicles, and scenario peds.Config.NPCBehavior: ambient ped and driver behavior.Config.VehicleSettings: traffic limits, vehicle suppression, emergency response, and player avoidance.Config.ScenarioSettings: scenario-group suppression and animal filtering.Config.TimeBasedSettings: day/night density overrides.Config.WantedSystem: wanted and dispatch controls.Config.Relationships: relationship groups for players, cops, gangs, and civilians.Config.Advanced: update interval, range, cleanup, and debug controls.Config.Advanced.clearAmbientGarbageOnClear: when enabled,/npcclearalso removes common loose trash and rubble props.Config.Blacklist/Config.Whitelist: ped model filtering.Config.Events: local client event toggles.Config.Commands/Config.Security: admin command and permission rules.
Panel/runtime editing notes:
- The in-game panel can be opened with
/cbknpc(or whateverConfig.Commands.panelCommandis set to), and that command also powers the_bind_<key>alias thatRegisterKeyMappinguses. - Change
Config.Commands.panelKeywhen you want to rebind the keyboard shortcut without editing the slash command. - Command-name and panel-key changes still require a resource restart.
/npcreloadkeeps the live runtime config aligned with the currently registered command surface. - The panel is organized into
Core Runtime,Ped AI,Traffic Systems,World & Scenarios, andMaintenance. - Runtime profiles are stored under
profiles/cbk_panel/.
Important precedence rules:
- Moving traffic density comes from
Config.PopulationDensity.vehicleDensity, or the activeConfig.TimeBasedSettings.*.vehicleDensitywhen time-based settings are enabled. Config.SpawnControl.disableAmbientPedsis the canonical hard stop for ambient peds in the shipped config.Config.NPCBehavior.respectTrafficLightsandConfig.NPCBehavior.respectStopSignsare base ambient driver preferences, whileConfig.VehicleSettings.vehiclesRespectLightsis the traffic-controller enforcement layer.
Use this table during live tuning to avoid setting combinations that cancel each other.
| Setting | Depends On | Overrides / Conflicts With | Practical Note |
|---|---|---|---|
Config.EnableNPCs |
None | Pauses ambient behavior/shaping when false |
Use this as the master runtime switch before troubleshooting individual sections. |
Config.PopulationDensity.* |
Config.PopulationDensity.enabled = true |
SpawnControl hard suppression flags |
Density can be non-zero but still suppressed. |
Config.SpawnControl.disableAmbientPeds |
Config.SpawnControl.enabled = true |
PopulationDensity.pedDensity, TimeBasedSettings ped values |
Hard suppression wins over all ped density controls. |
Config.SpawnControl.disableVehicleSpawn |
Config.SpawnControl.enabled = true |
PopulationDensity.vehicleDensity, TimeBasedSettings vehicle values, VehicleSettings.enableTraffic |
If true, moving-traffic tuning has little effect. |
Config.SpawnControl.disableParkedVehicles |
Config.SpawnControl.enabled = true |
PopulationDensity.parkedVehicleDensity |
Parked vehicle density is ignored when hard-suppressed. |
Config.SpawnControl.disableScenarioPeds |
Config.SpawnControl.enabled = true |
PopulationDensity.scenarioPedDensity, scenario enable flags |
Use when you need guaranteed scenario removal. |
Config.TimeBasedSettings.* |
Config.TimeBasedSettings.enabled = true |
Base PopulationDensity values during active period |
Day/night profile can mask base density edits. |
Config.ScenarioSettings.disableAllScenarios |
None | Individual scenario toggles (disableCops, etc.) |
Global switch takes precedence. |
Config.VehicleSettings.enableTraffic |
None | Most moving traffic controls when false |
Treat as traffic master kill switch. |
Config.NPCBehavior.respectTrafficLights |
None | Can be softened by aggressive styles | Pair with VehicleSettings.vehiclesRespectLights = true for consistency. |
Config.NPCBehavior.respectStopSigns |
None | Can be masked when VehicleSettings.vehiclesRespectLights = false |
Use this when you want stronger full-stop behavior at signed intersections. |
Config.VehicleSettings.vehiclesRespectLights |
None | Can appear inconsistent if base respectTrafficLights=false |
Keep both true for stable city behavior. |
Config.WantedSystem.npcReportVehicleTheft/Assault/Shooting |
npcReportCrimes = true |
No effect when npcReportCrimes=false |
Enable master report toggle first. |
Config.Whitelist.enabled |
None | Can conflict with Blacklist.enabled |
Prefer one list strategy at a time. |
Config.Commands.requirePermission |
None | Disables permission gating when false |
Keep true in production servers. |
Config.Security.allowAcePermissions |
ACE rules configured | Uses identifier list path when false |
Choose one clear admin auth strategy. |
- Population and suppression:
EnableNPCs,PopulationDensity.*,SpawnControl.disableAmbientPeds,SpawnControl.disableVehicleSpawn,SpawnControl.disableParkedVehicles,SpawnControl.disableScenarioPeds. - Ambient ped reaction layer:
ignorePlayer,fleeFromPlayer,panicFromGunfire,reactToExplosions,reactToFire,reactToDeadBodies,reactToSirens. - Ambient ped perception and combat:
disableNPCWeapons,disableNPCCombat,npcAccuracy,npcShootRate,combatAbility,combatMovement,pedAlertness,pedSeeingRange,pedHearingRange,moveRateOverride. - Ambient ped audio, animation, and survivability:
disableAmbientSpeech,disableAmbientHorns,disablePainAudio,disableAmbientAnims,disableAmbientBaseAnims,disableGestureAnims,allowPlayerMelee,npcCanRagdoll,npcCanBeKnockedOffBike,canEvasiveDive,canCowerInCover,canBeTargetted,canBeTargettedByPlayer,canBeShotInVehicle,canBeDraggedOutOfVehicle. - Ambient ped pathing:
canUseLadders,canUseClimbovers,canDropFromHeight,pathAvoidFire. - Ambient driver control:
disableNPCDriving,npcDrivingStyle,respectTrafficLights,respectStopSigns,avoidTraffic,PopulationDensity.vehicleDensity,VehicleSettings.enableTraffic,VehicleSettings.maxVehicles,VehicleSettings.vehiclesRespectLights,VehicleSettings.vehiclesUseIndicators,VehicleSettings.enableVehicleDamage,VehicleSettings.vehiclesAvoidPlayer. - Emergency traffic response:
VehicleSettings.emergencyVehicleBehavior.*, including slow-pass, oncoming bypass, stopped-emergency bubbles, emergency-signal requirement, optional siren-audio requirement, horn suppression, and speech suppression. - Ambient cleanup and world shaping:
Advanced.maxAmbientPeds,Advanced.autoCleanupEnabled,Advanced.cleanupDistance,Advanced.cleanupInterval,Advanced.deleteDeadNPCs,Advanced.cleanupDeadNPCsAfterMs,Advanced.deleteWreckedEmptyVehicles,Advanced.cleanupWreckedVehiclesAfterMs,Advanced.deleteAbandonedEmptyVehicles,Advanced.cleanupAbandonedVehiclesAfterMs,Advanced.abandonedVehicleSpeedThresholdMph. - Clear-world extras:
Advanced.clearAmbientGarbageOnClearextends/npcclearto include common loose trash and rubble props.
Notes on reaction toggles:
panicFromGunfire,reactToExplosions,reactToFire,reactToDeadBodies, andreactToSirensare applied through GTA ambient AI behavior rather than completely separate internal channels.- Live edits to
NPCBehavior.*andRelationships.*now force a nearby ped-state refresh and an immediate ambient re-apply pass so panel changes land more reliably on already-loaded ambient peds. - Some changes are still more visible on newly managed ambient peds than on the exact same ped that was already modified.
disableNPCWeaponsis the clearest example because GTA will not automatically restore weapons to an already-disarmed ambient ped.
Notes on relationships:
Relationships.playerToNPCandRelationships.npcToPlayertarget the player versus non-player groups.Relationships.npcToNPCapplies between non-player ambient groups and no longer overwrites the player-specific relationship values.
All commands are server-owned and permission protected by default.
/npcreload: reloadsconfig.luaand re-synchronizes clients. Command-name and panel-key changes still need a resource restart./npctoggle: flipsConfig.EnableNPCs.Config.Commands.panelKey: opens the CBK Panel using the configured keyboard bind./cbkpanelsaveor your configuredpanelSaveCommand: saves the current runtime state to theruntimepanel profile./cbkpanelloador your configuredpanelLoadCommand: loads theruntimepanel profile back into the live config./cbkpanelunlockor your configuredpanelUnlockCommand: releases a stuck panel lock./npccount: shows recent nearby ambient ped and vehicle counts./npctrafficstats: shows current traffic-context telemetry snapshot (indexed on-foot players and anchor distribution)./npctrafficstatsreset: resets the traffic-context telemetry window and prints the previous window summary./npcstatus: shows revision, mode, and recent client runtime data./npcvalidate: reports whether config normalization changes anything./npcclear: broadcasts a full ambient-world purge to clients, briefly suppresses repopulation while the clear runs, preserves player-associated vehicles, and optionally clears common loose trash and rubble props whenAdvanced.clearAmbientGarbageOnClear = true.
- Resource-local admin identifiers are configured in
Config.Security.adminIdentifiers. - ACE is optional and off by default with
Config.Security.allowAcePermissions = false. - Client init and runtime-report events are rate limited.
- Payload depth and node count are validated server-side.
- Periodic security telemetry summaries are printed when activity is present.
- Place
cbk-npcin your serverresourcesfolder. - Add
ensure cbk-npctoserver.cfg. - Set your admin identifiers in
Config.Security.adminIdentifiers. - Restart the resource or server.
- Run
/npcstatusin game to confirm the config revision is live. - Press your configured
Config.Commands.panelKeyif you want to use the runtime panel.
More setup detail is in INSTALLATION.md , and ready-to-use presets are in EXAMPLES.md
Recommended smoke test after config changes:
- Restart the resource and confirm there are no startup errors.
- Run
/npcstatusand/npcvalidate. - Toggle traffic density or scenario settings, then run
/npcreload. - Drive an emergency vehicle with emergency lights active, and with siren audio active as well if
requireSiren = true, and confirm traffic pulls over or slow-passes as expected. - Step out on or near a road and confirm ambient traffic slows or routes around you when
vehiclesAvoidPlayer = true.
- Server-side authority, event rate limits, payload safety checks, and config normalization remain active.
- Emergency traffic control now reserves exclusive ownership of ambient NPC drivers while slow-pass, stopped-emergency, or pedestrian-avoidance tasks are active, so the ambient driver loop does not overwrite those tasks mid-maneuver.
- Stopped-emergency lead ownership is computed once per anchor per traffic update. Only the lead vehicle gets bypass authority; followers stay in managed slow-pass instead of stacking side-by-side passes.
- Live panel edits are normalized with cross-field emergency invariants before broadcast. Conflicting bubble, courtesy, slow-pass, and bypass values are corrected server-side.
- Traffic-context cadence follows
Config.Advanced.updateInterval, clamped to a 250-1000ms active window and a 1000ms minimum when the feature is disabled.
Recommended 120-player baseline:
Config.Advanced.updateInterval = 1250to1500Config.Advanced.maxNPCDistance = 300.0to400.0Config.VehicleSettings.maxVehicles = 35to60Config.Advanced.suppressionLevel = 'high'for event spikes
- This resource now documents only the ambient-only runtime that ships in this repository.
- If an older config still contains legacy ped-suppression aliases, the runtime may still read them, but new configs should use the shipped
disableAmbientPedssetting.