> For the complete documentation index, see [llms.txt](https://docs.easy.gg/scripting/llms.txt). Markdown versions of documentation pages are available by appending `.md` to page URLs; this page is available as [Markdown](https://docs.easy.gg/scripting/bedwars-scripting/services/soundservice.md).

# SoundService

Example usage:

```lua
-- Play a honk sound whenever an entity takes damage
Events.EntityDamage(function(event)
    local attackedPosition = event.entity:getPosition()
    SoundService.playSound(SoundType.VOICE_HONK, attackedPosition)
end)
```

### Functions

#### playSound(sound: [SoundType](/scripting/bedwars-scripting/types/soundtype.md), position: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3) | nil)

Plays a sound globally. You can optionally specify where the sound will come from.

#### playSoundForPlayer(player: [Player](broken://pages/fOfVQF5nlALekCoylPz2), sound: [SoundType](/scripting/bedwars-scripting/types/soundtype.md), position: [Vector3](https://create.roblox.com/docs/reference/engine/datatypes/Vector3) | nil)

Plays a sound for a specific player. You can optionally specify where the sound will come from.
