# AiState.isDone

Checks if the AI state is done.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
aiState:isDone(  )
```

[Open the full Game reference](../Game-Script-Environment/Userdata/AiState.md#isdone)

**Availability:** Server only

Returns true when the state is done, and a string describing the state's current situation.

Can be used to determine if another state is allowed to be started.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `state` | [AiState](../Game-Script-Environment/Userdata/AiState.md) | The state. |

**Returns:**

| Type | Description |
| --- | --- |
| boolean<br>string | Returns true when done, and a string description. |
