📥Exports
Configuration guide of Advanced Warning Zone System.
Client Exports
addZone
exports["stg-warnzone"]:addZone(name, dangerLevel, meter, time, customCoords)This export creates a warning zone based on the parameters you provide. You can assign a name to the zone, define its range, set the trigger distance, specify how long the player must stay in the area, and optionally use custom coordinates.
Parameters:
name (string) — The name of the zone you want to create.
dangerLevel (number) — The danger level of zone (1-5).
meter (number) — The distance at which the warning should trigger.
time (number) — The duration (in minute) of zone.
customCoords (vector3 / nil) — Optional custom coordinates for zone placement.
Return:
returns the zoneID.
Examples:
exports["stg-warnzone"]:addZone("robbery", '4', '50', 5, false)exports["stg-warnzone"]:addZone("robbery", '5', '100', 10, vec3(x, y, z))
removeZone
exports["stg-warnzone"]:removeZone(zoneID)This function removes a previously created zone using its unique zone ID. Once removed, the warning zone is no longer active and will not trigger any checks.
Examples:
exports["stg-warnzone"]:removeZone(1)
getZones
exports["stg-warnzone"]:getZones()This function returns all currently created zones along with their full data. It’s useful for debugging, listing active zones, or managing them dynamically.
getZoneById
exports['stg-warnzone']:getZoneById(id)This function returns the data of a specific zone using its unique ID. If the zone exists, it will return all of its information.
Examples:
local zone = exports['stg-warnzone']:getZoneById(1)
openMenu
exports['stg-warnzone']:openMenu()This Export opens the Warn Zone Menu, allowing you to manage, view, and edit all zone-related settings directly from the interface.
Examples:
exports['stg-warnzone']:openMenu()
Server Exports
addZone
exports["stg-warnzone"]:addZone(name, dangerLevel, meter, time, customCoords)This export creates a warning zone based on the parameters you provide. You can assign a name to the zone, define its range, set the trigger distance, specify how long the player must stay in the area, and optionally use custom coordinates.
Parameters:
name (string) — The name of the zone you want to create.
dangerLevel (number) — The danger level of zone (1-5).
meter (number) — The distance at which the warning should trigger.
time (number) — The duration (in minute) of zone.
customCoords (vector3 / nil) — Optional custom coordinates for zone placement.
Return:
returns the zoneID.
Examples:
exports["stg-warnzone"]:addZone("robbery", '4', '50', 5, false)exports["stg-warnzone"]:addZone("robbery", '5', '100', 10, vec3(x, y, z))
removeZone
exports["stg-warnzone"]:removeZone(zoneID)This function removes a previously created zone using its unique zone ID. Once removed, the warning zone is no longer active and will not trigger any checks.
Examples:
exports["stg-warnzone"]:removeZone(1)
Last updated