This script automatically deletes NPCs (peds) from defined zones in the game. You can also configure the script to remove vehicles (cars) and NPCs simultaneously if required (Update coming soon).
In the config.lua file, you can define deletion zones by adding coordinates and additional parameters as needed.
Make sure you configure the zones and deletion options correctly for your needs before running the script.
I sincerely thank you for this release. I had been waiting for a while for a resource to remove peds within a polyzone. I downloaded it and it works perfectly. As for the criticism from unhappy individuals, it shouldn’t be given any attention. Instead of complaining, they could have created the same script themselves. Keep up the good work!
ok after some testing and stuff
i made this code that works perfectly
local clearZone
CreateThread(function ()
clearZone = PolyZone:Create({
vector2(136.33488464355, -988.24456787109),
vector2(134.28204345703, -984.10620117188),
vector2(183.35543823242, -849.33679199219),
vector2(187.51835632324, -846.94079589844),
vector2(258.92813110352, -873.09356689453),
vector2(259.10818481445, -876.51281738281),
vector2(208.74333190918, -1014.4515991211)
}, {
name = "clearZone",
debugPoly = false -- Change to true if you want to visualize the zone for debugging
})
end)
local function clearPedsInZone()
local pedHandle, ped = FindFirstPed()
local success
repeat
if not IsPedAPlayer(ped) then
local pedPos = GetEntityCoords(ped)
if clearZone:isPointInside(pedPos) then
DeleteEntity(ped)
end
end
success, ped = FindNextPed(pedHandle)
until not success
EndFindPed(pedHandle)
end
CreateThread(function ()
while true do
Wait(2000)
clearPedsInZone()
end
end)
it does exactly what this guy is selling
if you want the vehicle version just add or change the ped code to vehicle stuff, make sure it is not owned by players