> For the complete documentation index, see [llms.txt](https://stg-store.gitbook.io/documentation/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://stg-store.gitbook.io/documentation/scripts/advanced-warning-zone/exports.md).

# Exports

#### Client Exports

***

<details>

<summary><code>addZone</code></summary>

{% code overflow="wrap" %}

```lua
exports["stg-warnzone"]:addZone(name, dangerLevel, meter, time, customCoords)
```

{% endcode %}

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))`

</details>

<details>

<summary><code>removeZone</code></summary>

{% code overflow="wrap" %}

```lua
exports["stg-warnzone"]:removeZone(zoneID)
```

{% endcode %}

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)`

</details>

<details>

<summary><code>getZones</code></summary>

{% code overflow="wrap" %}

```lua
exports["stg-warnzone"]:getZones()
```

{% endcode %}

This function returns all currently created zones along with their full data. It’s useful for debugging, listing active zones, or managing them dynamically.

</details>

<details>

<summary><code>getZoneById</code></summary>

```lua
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)`

</details>

<details>

<summary><code>openMenu</code></summary>

{% code overflow="wrap" %}

```lua
exports['stg-warnzone']:openMenu()
```

{% endcode %}

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()`

</details>

#### Server Exports

***

<details>

<summary><code>addZone</code></summary>

{% code overflow="wrap" %}

```lua
exports["stg-warnzone"]:addZone(name, dangerLevel, meter, time, customCoords)
```

{% endcode %}

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))`

</details>

<details>

<summary><code>removeZone</code></summary>

{% code overflow="wrap" %}

```lua
exports["stg-warnzone"]:removeZone(zoneID)
```

{% endcode %}

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)`

</details>

<details>

<summary><code>getZones</code></summary>

{% code overflow="wrap" %}

```lua
exports["stg-warnzone"]:getZones()
```

{% endcode %}

This function returns all currently created zones along with their full data. It’s useful for debugging, listing active zones, or managing them dynamically.

</details>

<details>

<summary><code>getZoneById</code></summary>

```lua
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)`

</details>
