# sm.player.getAllPlayers

Returns a table of all [players](../Game-Script-Environment/Userdata/Player.md) that are currently in the game.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.player.getAllPlayers( getInactive? )
```

[Open the full Game reference](../Game-Script-Environment/Static-Functions/sm.player.md#getallplayers)

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `getInactive` *(optional)* | boolean | Include getting inactive players. Defaults to false. (Optional) |

**Returns:**

| Type | Description |
| --- | --- |
| table | Table of all players in the game. \{[Player](../Game-Script-Environment/Userdata/Player.md), ..\} |
