Server
Manipulate the sound
If you don't pass -1 to source, sound will not be saved on the server side. So there will be no sync.
Play
local soundId = exports['mx-surround']:Play(source, soundId, url, coords, loop, volume, panner)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
Parameters
source:
numberYou can pass -1 for sync
soundId?:
stringIf not provided, will be created automatically
url:
stringcoords:
vector3Unlike the client side the coords param is required on the server side
loop?:
booleanvolume?:
numberOverride default volume (even if sound profile is enabled)
panner?:
PannerNode
Returns
soundId | false
Play Async
This export does not return the soundId compared to the above. However, it works faster and you can connect the sound directly to an entity or player at startup. Very useful for asset sounds
It should only be used for asset sounds, DO NOT use it for youtube, spotify and soundcloud!
Parameters
source:
numberYou can pass -1 for sync
soundId?:
stringIf not provided, will be created automatically
url:
stringcoords:
vector3Unlike the client side the coords param is required on the server side
loop?:
booleanvolume?:
numberOverride default volume (even if sound profile is enabled)
panner?:
PannerNodedata?:
{ attachEntity: number, attachPlayer: number }
Stop
Parameters
source:
numbersoundId:
string
Pause
Parameters
source:
numbersoundId:
string
Resume
Parameters
source:
numbersoundId:
string
Destroy
Parameters
source:
numbersoundId:
string
Destroy All
Attach Entity
Parameters
source:
numbersoundId:
stringnetworkId:
number
Detach Entity
Parameters
source:
numbersoundId:
string
Attach To Player
Parameters
source:
numbersoundId:
stringplayerId:
number
Detach From Player
Parameters
source:
numbersoundId:
string
Last updated
Was this helpful?