# SScene

## Index

### Properties Index

| Property                                            |
| --------------------------------------------------- |
| int [**ConnectedAvatars** ](#connectedavatars)`get` |
| Table [**Avatars** ](#avatars)`get`                 |
| Table [**Cells** ](#cells)`get`                     |
| SParcelManager [**Parcels** ](#parcels)`get`        |

## Properties

### ConnectedAvatars

int **ConnectedAvatars** `get`

*Returns the number of Avatars connected to the region.*

{% tabs %}
{% tab title="Lua" %}

```lua
numOfAvatars = Space.Scene.ConnectedAvatars
```

{% endtab %}
{% endtabs %}

{% tabs %}
{% tab title="Lua" %}

```lua
function OnAvatarJoin(id)
  local numOfAvatars = Space.Scene.ConnectedAvatars
  Space.Log("Avatar with ID " .. id .. "has joined")
  Space.Log("Number of avatars connected: " .. numOfAvatars)
end
```

{% endtab %}
{% endtabs %}

### Avatars

Table **Avatars** `get`

*Returns a table of SAvatar objects currently in the region*

{% tabs %}
{% tab title="Lua" %}

```lua
currentAvatars = Space.Scene.Avatars
```

{% endtab %}
{% endtabs %}

### Cells

Table **Cells** `get`

*Returns a table of SCell objects. (Not all cells are available at all times, a client on this server must be within 384m of a cell in order for it to exist.)*

{% tabs %}
{% tab title="Lua" %}

```lua
cellsTable = Space.Scene.Cells
```

{% endtab %}
{% endtabs %}

### Parcels

[SParcelManager](https://docs.breakroom.tech/scripting/server-scripting-api-reference/region/sparcelmanager) **Parcels** `get`

*Access to the SParcelManager class.*

{% tabs %}
{% tab title="Lua" %}

```lua
Space.Scene.Parcels
```

{% endtab %}
{% endtabs %}
