M MY Multiplayer: Wiki
Side
Kind

engineAddSound

Client

Registers an audio file under a name, which playSound and playSound3D then play by that name.

bool engineAddSound(string name, string path [, int priority = 0])

Parameters

NameTypeDescription
namestringThe sound's name, up to 255 characters. Case does not matter.
pathstringPath of the audio file in the resource.
priorityintPriority among those who register the same name. The highest wins; among equals, the newest.default 0

Returns

true if the sound was registered. Raises an error if the name is too long or the file cannot be read.

The sounds a resource registered are removed when it stops.

Example

engineAddSound("horn_custom", "sounds/horn.ogg")
playSound("horn_custom")

See also