-- 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: , position: | nil)
Plays a sound globally. You can optionally specify where the sound will come from.