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

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

Asked by 10 years ago

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

Log in to vote
0
Answered by
Relatch 550 Moderation Voter
10 years ago
while true do
    songs = script.Parent.Radio:GetChildren()
    playsong = math.random(1,#songs)
    songs[playsong]:Play()
    wait(130)
    songs[playsong]:Stop()
end

0
Thanks, even though everytime I die it messes up, we both forgot a debounce. fahmisack123 385 — 10y
0
You're welcome, could you give me a thumbs up if you didn't already? Relatch 550 — 10y
Ad
Log in to vote
-2
Answered by 10 years ago

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

0
The maximum length of a song is 120 seconds. On the ROBLOX Library fahmisack123 385 — 10y
0
I see well after the 120 seconds do songs[playsong]:Stop() DragonSkyye 517 — 10y
0
You might also have another sound file playing DragonSkyye 517 — 10y

Answer this question