M MY Multiplayer: Wiki
Side
Kind

setSoundPosition

Shared

Jumps to a point in the track. The value is kept between 0 and the sound's length. On the server, the change is sent to every client.

bool setSoundPosition(sound sound, float seconds)

Parameters

NameTypeDescription
soundsoundThe sound element. On the client a dui element also works, for the browser's sound.
secondsfloatThe point in the track, in seconds.

Returns

true if the position changed, false if the sound was not found or has no length.

Example

local music = playSound("sounds/track.mp3")
setSoundPosition(music, 42.5)
NoteThis is the playback position, not the position in the world. To move a 3D sound, use setElementPosition.

See also