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

How to pick a new song if it's random?

I am making a sound system that will play a random song and I could successfully do that, however, I want to pick a new song to play when the random song is done playing. I just don't know how to manage this.

Here is the code:

local musicTable =  script.Music:GetChildren() --  yes i recycled this from my impact sound script :troll:
local randomSong = musicTable[math.random(1, #musicTable)]

Sorry, it's just those 2 variables.

4 comments

0

So I'm pretty sure you're trying to make a sound system that plays random music and has a skipping feature https://scriptinghelpers.org/questions/126153/why-this-local-script-isnt-skipping-random-music#114757

0

I'm not trying to have a skipping feature, but I want a song to play when the song that was selected randomly is over. This is my fault, I didn't clarify.

0

You can edit by the way. Might get taken down for being Non-Descriptive

0

So you want to play a new random song after one song has finished?

1 answer

randomSong.Ended:Connect(function()--when the song end
nextsong:Play()--play the next song

end)

MarkedTomato why dont you understand

2 comments

0

WHAT? you have nothing no explanation even I don't know what you're doing. edit your post and give it a balance of an explanation and some code

0

Why did you edit your answer to ask a question that could have been a comment? Also, please see the attached note and adjust your answer accordingly.

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