SOUND
Audio playback and control.
Availability: Client-only
Methods
SOUND.play2D
client
Play a 2D sound effect (not positional)
Signature: obj action(num, num, num, bool)
Parameters:
| Name | Type | Description |
|---|---|---|
aid | num | Sound asset ID |
vol | num | Volume level (0-1) |
rate | num | Playback rate multiplier |
loop | bool | Whether to loop the sound |
Returns: obj - Sound control object with volume, rate, fade, play, stop, pause, mute, unmute methods
obj result = GAME.SOUND.play2D("asset_id", 1.0, 1.0, true);
SOUND.play3D
client
Play a 3D positional sound at a specific location
Signature: obj action(num, num, num, num, num, num, bool)
Parameters:
| Name | Type | Description |
|---|---|---|
aid | num | Sound asset ID |
vol | num | Volume level (0-1) |
x | num | X position in 3D space |
y | num | Y position in 3D space |
z | num | Z position in 3D space |
rate | num | Playback rate multiplier |
loop | bool | Whether to loop the sound |
Returns: obj - Sound control object
obj result = GAME.SOUND.play3D("asset_id", 1.0, 0, 10, 0, 1.0, true);
SOUND.stop
client
Stop a currently playing sound
Signature: action(num)
Parameters:
| Name | Type | Description |
|---|---|---|
aid | num | Sound asset ID to stop |
GAME.SOUND.stop("asset_id");