Decrease the amount of NPC, and Cars


#1

How,

What scrip would decrease the number of NPC spawning? I once saw a script about this, cannot find it.


#2

Create a folder create a _resource.lua
create a client.lua and put this in the client.lua

DensityMultiplier = 0.45
Citizen.CreateThread(function()
	while true do
	    Citizen.Wait(0)
	    SetVehicleDensityMultiplierThisFrame(DensityMultiplier)
	    SetPedDensityMultiplierThisFrame(DensityMultiplier)
	    SetRandomVehicleDensityMultiplierThisFrame(DensityMultiplier)
	    SetParkedVehicleDensityMultiplierThisFrame(DensityMultiplier)
	    SetScenarioPedDensityMultiplierThisFrame(DensityMultiplier, DensityMultiplier)
	end
end)

Your welcome :slight_smile:


#3

@KrizFrost

Thanks!!!

Another question, could you help me with a simple script that makes you spawn in a specific vehicle on join? :slight_smile:


#4

This is something your going to need to use when someone joined the server, now keep in mind you are going to need to specify some things but here it is

TaskWarpPedIntoVehicle(playerPed, vehicle, -1)

I took it from the esx_vehicleshop should really look at that script cause when you buy a vehicle it spawns you in the car at a certain “spawn” location specified in that script but that should help you.


#5

@KrizFrost I ye figured that much, im atm at this stage, now sure how to keep going:

AddEventHandler(‘playerSpawned’, function()
local pos = GetEntityCoords(PlayerPedId())
local vehicle = CreateVehicle(“zentorno”, pos, 0.0, true, false)
TaskWarpPedIntoVehicle(PlayerPedId(), vehicle, -1)
end)