Well, the music plays only once for 100 seconds, then it doesn't choose music again. I don't know if I did something wrong or not, please help me. It also doesn't error when it's looped a full 100 seconds.
music = {176407800, 166886402, 183503743, 185698490, 165065112, 145127587, 155146819, 178066730, 137985283}
while true do
local id = math.random(1, #music)
game.Workspace.Sound.SoundId = "rbxassetid://" .. music[id]
game.Workspace.Sound:Play()
wait(100)
game.Workspace.Sound:Stop()
end

2 comments
Is it in a regular script?
Yes.