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

Why does this loop not play more than one sound?

Asked by 9 years ago

I have some code that plays all of the sounds within a brick, one after the other.

Sounds = workspace[levelid].Sound:GetChildren() for i,sound in pairs(Sounds) do

sound:Play()
while sound.IsPlaying do
    wait(.5)
end
sound:Destroy()

end

This plays the sound but then doesn't play the next sound. Can anyone help?

Answer this question