sound

Play sounds, from the game or your mod.

Sound files are found by name like every game file: the game's own (e.g. "hwalk1.wav") or .wav files your mod ships (put mysound.wav anywhere in your mod's folder and play "mysound.wav").

On this page

Functions

# sound.play(file, volume?) → boolean

Plays a sound for the hunter (not positioned).

ParameterType
filestringa .wav file name
volume optionalnumber0-1 (default 1)
Returns
booleanfalse when it could not be played
sound.play("bell.wav", 0.8)

# sound.playAt(file, x, y, z, volume?, radius?) → boolean

Plays a sound at a point of the world.

ParameterType
filestring
xnumber
ynumber
znumber
volume optionalnumber
radius optionalnumberhow far it carries (default 8000)
Returns
boolean
local x, y, z = c:pos()
sound.playAt("roar.wav", x, y, z, 1, 20000)