# setCinematicDuration (Client)

> Fixes the cinematic's duration. Playback ends when it gets there.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Client
- **Category**: Cinematics
- **URL**: https://wiki.mymp.gg/en/setCinematicDuration

## Syntax

```lua
bool setCinematicDuration(cinematic cinematic, int time)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `cinematic` | `cinematic` | The cinematic. |
| `time` | `int` | Duration in ms. `0` makes it last up to the last thing in it again. |

## Returns

`true` if it was set, `false` if the element is not a cinematic.

## Example

```lua
local intro = createCinematic("cinematics/intro.cine")
setCinematicDuration(intro, 30000)
playCinematic(intro)
```

## See also

- [getCinematicDuration (Client)](https://wiki.mymp.gg/en/getCinematicDuration.md): Returns how long the cinematic lasts.
- [playCinematic (Client)](https://wiki.mymp.gg/en/playCinematic.md): Plays the cinematic: the actors as local clones, plus the camera, weather, hour, fade, sounds and captions.
- [onClientCinematicFinish (Client)](https://wiki.mymp.gg/en/onClientCinematicFinish.md): Fired when a cinematic's playback reaches its end by itself.
