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

What is wrong with this multiple song looping script?

Asked by 9 years ago

I've just made a script for music sound playing but seems when I go in to to game, I don't hear the music which mean I can't find a error in the script. What's wrong this script? It seems fine...I guess?

while true do
wait(3600)
end

script.Parent.Sound:Play()
wait(180)
script.Parent.Sound:Stop()
wait(0.01)
script.Parent.Sound2:Play()
wait(180)
script.Parent.Sound2:Stop()
wait(0.01)
script.Parent.Sound3:Play()
wait(180)
script.Parent.Sound3:Stop()
wait(0.01)
script.Parent.Sound4:Play()
wait(180)
script.Parent.Sound4:Stop()
wait(0.01)
script.Parent.Sound5:Play()

1 answer

Log in to vote
0
Answered by
1waffle1 2908 Trusted Badge of Merit Moderation Voter Community Moderator
9 years ago

The beginning of the script tells it to wait one hour, and when it's finished waiting an hour, wait another hour, and don't stop waiting an hour. After it stops (it doesn't) is when it does the other things after it.

Solution: get rid of the first 3 lines:

script.Parent.Sound:Play()
wait(180)
script.Parent.Sound:Stop()
wait(0.01)
script.Parent.Sound2:Play()
wait(180)
script.Parent.Sound2:Stop()
wait(0.01)
script.Parent.Sound3:Play()
wait(180)
script.Parent.Sound3:Stop()
wait(0.01)
script.Parent.Sound4:Play()
wait(180)
script.Parent.Sound4:Stop()
wait(0.01)
script.Parent.Sound5:Play()
Ad

Answer this question