# Effect.setAutoPlay

Sets an effect to start playing and repeating automatically.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
effect:setAutoPlay( autoplay, autoPlayOnce?, resetPlayOnce? )
```

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

**Availability:** Client only

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `effect` | [Effect](../Game-Script-Environment/Userdata/Effect.md) | The effect. |
| `autoplay` | boolean | Autoplay enabled. |
| `autoPlayOnce` *(optional)* | boolean | If set the effect will not loop when autoplaying. (Defaults to false) (Optional) |
| `resetPlayOnce` *(optional)* | boolean | Will reset the autoPlayOnce condition, allowing the effect to play again if it already has since earlier. (Defaults to false) (Optional) |
