Remove Peds within a designated polyzone.

:man_standing: Delped



Requirements

  • ESX
  • Polyzone

:information_source: Informations

English :

Hi everyone!

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.

French :

Salut tout le monde !

Ce script permet de supprimer automatiquement les PNJ (ped) à partir de zones définies dans le jeu. Vous pourrez également configurer le script pour supprimer les véhicules (voitures) et les PNJ simultanément si nécessaire (Mise a jour a venir).

Dans le fichier config.lua, vous pouvez définir les zones de suppression en ajoutant des coordonnées.
Assurez-vous de configurer correctement les zones et les options de suppression selon vos besoins avant d’exécuter le script.


Upcoming updates :

  • delete vehicles
  • delete peds + vehicles

Screenshot :

Out of zone :

In the zone according to the peds to be deleted (example on the beach) :


:brick:Exigences et :gear:Configuration

Dependency : Polyzone (GitHub - mkafrin/PolyZone: PolyZone is a FiveM mod to define zones of different shapes and test whether a point is inside or outside of the zone)


Buy

Tebex

Code is accessible Partly
Subscription-based No
Lines (approximately) 90
Requirements ESX/ Polyzone
Support Yes
8 Likes

bro no way you are selling this when it took at most 5 minutes to make

2 Likes

Yes no worries then do it and share it if you want I don’t see any problem with that.

1 Like

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!

1 Like

bro brought his secondary account :rofl:

3 Likes

Nice work thanks

1 Like

does this work with qbcore?

Hello, for now, it’s only in esx because I’ve never worked with qbcore, but I will look into it for future updates

1 Like

excellent work!

this is perfect for a zombie server where you dont want zombies to spawn

1 Like

What is the need for framework in this resource?

1 Like

How is it so unoptimized that it idles usage? That’s literally the whole point of zones.

1 Like

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

have fun