# setSoundLooped (Shared)

> Turns looping on or off for a sound. On the server, the change is sent to every client.

- **Platform**: MY Multiplayer (MYMP)
- **Kind**: Lua Function
- **Side**: Shared
- **Category**: Sound
- **URL**: https://wiki.mymp.gg/en/setSoundLooped

## Syntax

```lua
bool setSoundLooped(sound sound, bool looped)
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `sound` | `sound` | The `sound` element. On the client a `dui` element also works, for the browser's sound. |
| `looped` | `bool` | `true` to play the sound again when it ends. |

## Returns

`true` if it changed, `false` if the sound was already set that way or was not found.

## Example

```lua
local music = playSound("sounds/track.mp3")
setSoundLooped(music, true)
```

## See also

- [isSoundLooped (Shared)](https://wiki.mymp.gg/en/isSoundLooped.md): Tells whether a sound plays again when it reaches its end.
- [playSound (Client)](https://wiki.mymp.gg/en/playSound-client.md): Plays a sound with no position in the world, on this client only. Fires onClientSoundStarted with the reason play.
- [playSound (Server)](https://wiki.mymp.gg/en/playSound-server.md): Creates a sound with no position in the world that every client plays together. Changes made to it on the server reach everyone.
