Skip to content

PlaySoundAt

Plays one of your sound files at a place, through the game’s own sound.

As PlayEntitySound, at a point with nothing to follow: a bell in a tower, music in a tavern, a crowd at a market. options takes volume, range and loop as PlayEntitySound does, and world, the virtual world (0).

PlaySoundAt(x, y, z, file [, options])
Parameter Type
x number metres
y number metres
z number metres
file string the file’s path in the sounds folder
options table {volume, range, loop, world} (optional)

number - the sound’s id; nil and the reason when it cannot play

-- the tavern's music, until the tavern closes
tavernMusic = PlaySoundAt(1288.4, 1104.2, 31.5, "tavern_lute.mp3", {range = 25, loop = true, volume = 0.6})

PlayEntitySound · PreloadSound · StopSound · IsSoundPlaying · the Sound files group of the index