Greetings! I'm trying to make a music player which picks a music located in SoundService randomly and once that music ends it will repeat the same process, however once I start the game only one is played and after it's finished the music stops.
The script:
local SoundService = game:GetService("SoundService")
local Sounds = SoundService.Songs:GetChildren()
local CurrentSong = game.SoundService.CurrentSong
local Sdelay = CurrentSong.TimeLength
while true do
CurrentSong = Sounds[math.random(1, 7)]
CurrentSong:Play()
wait(Sdelay)
CurrentSong.Ended:Wait()
end
