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

# Exports

Query zone state from your own resources. Resource name: **`aty_zonecreator`**.

### Server exports

#### `IsPlayerInZone(src, zoneId)` → `boolean`

Whether a player is currently inside a zone (server-tracked, not a client claim).

```lua
if exports['aty_zonecreator']:IsPlayerInZone(src, 'aty_tewwmg') then
    -- player is inside the lab
end
```

#### `GetPlayersInZone(zoneId)` → `table` (list of server ids)

Everyone currently inside a zone.

```lua
for _, src in ipairs(exports['aty_zonecreator']:GetPlayersInZone(zoneId)) do
    TriggerClientEvent('my:effect', src)
end
```

#### `GetTerritoryOwner(zoneId)` → `string | nil`

The gang that currently owns a territory zone (or `nil`).

```lua
local owner = exports['aty_zonecreator']:GetTerritoryOwner(zoneId)
```

#### `IsRobberyZone(zoneId)` → `boolean`

Whether the zone has the **Robbery** economy flag enabled.

### Client exports

#### `IsInZone(zoneId)` → `boolean`

Whether the local player is inside the given zone.

```lua
if exports['aty_zonecreator']:IsInZone('aty_8x1bzq') then ... end
```

#### `GetCurrentZones()` → `table`

The zones the local player is currently inside.

#### Restriction toggles

Drive the client-side restriction state directly (normally the zone does this for you — useful for custom integrations):

```lua
exports['aty_zonecreator']:SetPhoneRestricted(true)
exports['aty_zonecreator']:SetInventoryRestricted(true)
exports['aty_zonecreator']:SetVoiceRestricted(true)
```

{% hint style="info" %}
`zoneId` is the zone's stable **Zone ID** (e.g. `aty_tewwmg`), shown in the panel's Preferences section — **not** the internal `id`.
{% endhint %}
