Client
Manipulate the sound
Play
This export is a synchronous function, which means that this code returns a soundId to you. And if sound is not created, it returns false
With 1.8.5 players who are far away from the song will not be able to get the maxDuration
and timeStamp
of the song! If you want the far away player to get the maxDuration, you must use server side export
Parameters
soundId?:
string
If not provided, will be created automatically
url:
string
coords?:
vector3
If not provided, its means that the sound is not dynamic. So player can hear it from everywhere
loop?:
boolean
volume?:
number
Override default volume (even if sound profile is enabled) (0.0 | 1.0)
panner?:
PannerNode
Returns
soundId | false
Play Async
This is the same as a normal play export. The only difference is that it is async. So there is no return value
Attach To Entity
Parameters
soundId:
string
networkId:
number
Detach From Entity
Parameters
soundId:
string
Attach To Player
If you are going to attach to a player, you can of course use the attachEntity
. But you should definitely use this. Because if the player gets in the car, the script detects it with this export and filters the sound.
Parameters
soundId:
string
playerId:
number
Detach From Player
Parameters
soundId:
string
Stop
Parameters
soundId:
string
Pause
Parameters
soundId:
string
Resume
Parameters
soundId:
string
Destroy
Parameters
soundId:
string
Destroy All
Repeat
Parameters
soundId:
string
Add Filter
Parameters
soundId:
string
type:
string
filter:
{frequency: number, Q: number, gain:number}
Remove Filter
Parameters
soundId:
string
To better manage sounds, see these three section
Last updated