Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Waiting for music to load?

Here is part of the code I am using to load sounds into a Sound object. The code is then supposed to wait for the audio to load before it plays, by waiting for the TimeLength property of the Sound to be greater than 0.

Player.SoundId = SoundId
repeat wait() until Player.TimeLength > 0
Player:Play()

However, this only appears to work in Studio, and not in online mode.

Any ideas?

ADDITIONAL INFORMATION

• The script is running in ServerScriptService.

• The Sound object (Player) is created in Workspace.

1 answer

Try putting it into a localscript.

1 comment

0

It didn't help. I think that's because it's in the ServerScriptService. I've just added some additional information to the post.

This discussion is preserved as it was. New answers, comments, and votes are closed.