# playSFX3D (Client)

> Plays a sound from GTA San Andreas's audio banks at a position in the world.

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

## Syntax

```lua
sound|false playSFX3D(string container, int bank, int audio, float x, y, z [, bool looped = false])
```

## Parameters

| Name | Type | Description |
| --- | --- | --- |
| `container` | `string` | SA's audio container: `feet`, `genrl`, `pain_a`, `script`, `spc_ea`, `spc_fa`, `spc_ga`, `spc_na` or `spc_pa`. |
| `bank` | `int` | The bank number inside the container. |
| `audio` | `int` | The sound number inside the bank. |
| `x, y, z` | `float` | The sound's position in the world, as three numbers or one `vec3`. |
| `looped` | `bool` | Play the sound again from the start when it reaches the end. *(default: `false`)* |

## Returns

The created `sound` element, or `false` if the bank or the sound does not exist.

## Example

```lua
local pos = getElementPosition(localPlayer)
playSFX3D("genrl", 75, 0, pos)
```

### Coming from MTA

The `radio` container is not accepted: the function warns and returns `false`.

## See also

- [playSFX (Client)](https://wiki.mymp.gg/en/playSFX.md): Plays a sound from GTA San Andreas's audio banks, with no position in the world.
- [getSFXStatus (Client)](https://wiki.mymp.gg/en/getSFXStatus.md): Tells whether a GTA San Andreas audio container is available to playSFX and playSFX3D.
- [playSound3D (Client)](https://wiki.mymp.gg/en/playSound3D-client.md): Plays a sound at a position in the world, on this client only. Its volume falls with distance between setSoundMinDistance (5 m) and setSoundMaxDistance (20 m). Fires onClientSoundStarted with play.
