Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Waiting for music to load?

Asked by 9 years ago

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

Log in to vote
0
Answered by 9 years ago

Try putting it into a localscript.

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. glosgreen2 0 — 9y
Ad

Answer this question