The NoNPC resource is a simple but effective script for FiveM servers that prevents NPCs and vehicles from spawning in the game world. This ensures a more controlled and optimized multiplayer environment.
- Disables random NPC spawns, including police officers.
- Prevents garbage trucks and boats from spawning.
- Sets vehicle and pedestrian density to 0.0.
- Clears all NPCs and vehicles in a specified radius around the player.
- Removes vehicle generators within a set area.
- Place the NoNPC folder into your resources/ directory of your FiveM server.
Add the following line to your server.cfg file to ensure the script runs when the server starts:
ensure NoNPCRestart your FiveM server to apply the changes.
To adjust the NPC and vehicle density instead of completely disabling them, modify the values in main.lua:
SetVehicleDensityMultiplierThisFrame(0.1) -- 10% vehicle density
SetPedDensityMultiplierThisFrame(0.2) -- 20% NPC density- The script runs continuously in a loop to enforce the settings.
- Can be used alongside other mods to fine-tune NPC and vehicle behavior.
This script is free to use and modify for any FiveM server.
For any questions or modifications, feel free to ask!