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

Why are there 2+ Sounds playing at once?? [SOLVED]

What I want this script to do, is that a new song is played every 130 seconds. But there actually are 2+ sounds playing at the same time?? Can anyone help me fix this please? The songs are NOT looped.

while true do
	songs = script.Parent.Radio:GetChildren()
	playsong = math.random(1,#songs)
	songs[playsong]:Play()
	wait(130)
end

2 answers

✓ Accepted answer
while true do
    songs = script.Parent.Radio:GetChildren()
    playsong = math.random(1,#songs)
    songs[playsong]:Play()
    wait(130)
    songs[playsong]:Stop()
end

2 comments

0

Thanks, even though everytime I die it messes up, we both forgot a debounce.

0

You're welcome, could you give me a thumbs up if you didn't already?

Well for one u have a 'while true do' so it will loop continually. Even though it waits 130 seconds the song might be longer then that so it will overlap with another song thats playing

3 comments

0

The maximum length of a song is 120 seconds. On the ROBLOX Library

0

I see well after the 120 seconds do songs[playsong]:Stop()

0

You might also have another sound file playing

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