local sounds = {"158485547","157026036","158526174"}
local audio = workspace:WaitForChild("Music").Sound
local song = sounds[math.random(1,#sounds)]
local playing = false
audio.SoundId = "rbxassetid://"..song
local currentsong = song
while wait(1) do
if playing == false then
playing = true
audio:Play()
audio.Ended:Wait()
song = nil
song = sounds[math.random(1,#sounds)]
if song == currentsong then
song = nil
song = sounds[math.random(1,#sounds)]
end
audio.SoundId = "rbxassetid://"..song
audio:Play()
playing = false
end
end
For example, if the song is the 1st argument of the table, it will stay like that forever. It doesn't pick another random sound?

3 comments
Use tick.randomseed at line 17.
Sorry, but I'm not familiar with that.
Here's a aritcle about it https://developer.roblox.com/en-us/api-reference/lua-docs/math