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).
Syntax
Section titled “Syntax”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) |
Returns
Section titled “Returns”number - the sound’s id; nil and the reason when it cannot play
Example
Section titled “Example”-- the tavern's music, until the tavern closestavernMusic = PlaySoundAt(1288.4, 1104.2, 31.5, "tavern_lute.mp3", {range = 25, loop = true, volume = 0.6})See also
Section titled “See also”PlayEntitySound · PreloadSound · StopSound · IsSoundPlaying · the Sound files group of the index
