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

PlaybackSpeed changer on sound not working, any ideas?

Asked by 4 years ago

I have a sound in game.SoundScape that has properties Playing = true, and Looped = false. Also in game.SoundScape is a script that says:

sound = script.Parent["Tomba 2 OST - Ranch Area Cursed"]

while true do
    sound.Play()
    sound.PlaybackSpeed = math.random(1.0,2.1)
    while sound.Playing == false do
        wait(0.5)
    end
end

For some reason, when I test the game, the game only plays the sound once, and at the PlaybackSpeed of 1.

Any ideas as to why this is happening?

(I also tried a similar version, which omitted the sound.Play() function, and had the sound.Looped = true)

Answer this question