Poly Zones
polyZone.lua
This module provides helpers for creating and removing polygon or circular zones using PolyZone-compatible data structures.
createPoly(data)
Creates a polygonal zone using the detected polyzone library (ox_lib or PolyZone).
Automatically checks which polyzone script is active. When using ox_lib, it converts the provided 2D points to 3D (setting a constant z value) and sets a thickness value.
For PolyZone, it creates the zone and attaches onEnter and onExit callbacks for ease of use.
Example:
createCirclePoly(data)
When using ox_lib, it creates a sphere zone. For PolyZone, it creates a CircleZone and attaches onEnter and onExit callbacks.
Example:
removePolyZone(Location)
Removes a previously created polygon or circle zone by name.
Detects the active polyzone library and calls the appropriate removal method.
Example:
Last updated