[Release] [Standalone] Polyzone Tracking

Simple code to provide good optimisation with your scripts without the need of using multiple threads to track locations. Using the exports it adds the polyzones with the name you specify in the export. Then using one big thread it checks if the player has entered the zone. An event “bt-polyzone:enter” with the zone name is triggered when the player enters the zone. While in a zone it stops the check for checking other zones.

Creating zones you can go to 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 and read his readme.

Example and more details are in the GitHub readme.

Dependencies: 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

Download: GitHub - brentN5/bt-polyzone

Preview: test

3 Likes

it’ll be better for any preview

So if you add all the zones into this script what would you call in another script to know if you are in that area or not?

There is an example in Github of how you would use it. :grinning:

bt-polyzone:enter and bt-polyzone:exit are the events that are triggered.

I got it now. Thank you. Was thinking about it the wrong way.

Will these exports work with the target system too?

yes it does

1 Like

I’ve trying to use this script recently but I’ve found out that it isn’t registering me inside the zone even I’m right inside the zone is there’s anyways to fix that?

Send your code here so I can see how you did it

t/ pzundo should undo the last one you made