# sm.effect.playEffect

Plays an effect. If this function is called on the server it will play the effect on all clients.

**Kind:** Function

**Environments:** Game

## Game

``` { .lua .api-signature }
sm.effect.playEffect(
    name,
    position?,
    velocity?,
    rotation?,
    scale?,
    parameters?,
    startTime?,
    world?
)
```

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

> **Note:**
> If you start a looping effect using this function you will not be able to stop it.<br>Please use [createEffect](../Game-Script-Environment/Static-Functions/sm.effect.md#createeffect) for looping effects.

**Parameters:**

| Name | Type | Description |
| --- | --- | --- |
| `name` | string | The name. |
| `position` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The position. (Defaults to [0,0,0]) |
| `velocity` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The velocity. (Defaults to no velocity) |
| `rotation` *(optional)* | [Quat](../Game-Script-Environment/Userdata/Quat.md) | The rotation. (Defaults to no rotation) |
| `scale` *(optional)* | [Vec3](../Game-Script-Environment/Userdata/Vec3.md) | The scale. (Defaults to no scale, only applied to renderables) |
| `parameters` *(optional)* | table | The table containing the parameters for the effect. (Defaults to no parameters) |
| `startTime` *(optional)* | number | The initial time progression of the effect. Can be used to fast forward some effect parts. Can be used to delay effect part activation if negative. |
| `world` *(optional)* | [World](../Game-Script-Environment/Userdata/World.md) | The world to play the effect in. (Defaults to [World](../Game-Script-Environment/Userdata/World.md) from script context) |
