Skip to content

AradAshkan/FiveM-Disable-NPC-and-Vehicle-Spawn-Script

Folders and files

NameName
Last commit message
Last commit date

Latest commit

Β 

History

3 Commits
Β 
Β 
Β 
Β 

Repository files navigation

NoNPC - Disable NPC and Vehicle Spawns in FiveM

πŸ“œ Overview

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.

πŸš€ Features

  • 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.

πŸ“‚ Installation

1️⃣ Download and Extract

  • Place the NoNPC folder into your resources/ directory of your FiveM server.

2️⃣ Enable the Resource

Add the following line to your server.cfg file to ensure the script runs when the server starts:

ensure NoNPC

3️⃣ Restart Your Server

Restart your FiveM server to apply the changes.

βš™οΈ Customization

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

πŸ“Œ Notes

  • The script runs continuously in a loop to enforce the settings.
  • Can be used alongside other mods to fine-tune NPC and vehicle behavior.

πŸ“œ License

This script is free to use and modify for any FiveM server.


For any questions or modifications, feel free to ask!

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages