It works just fine in studio. but online it only plays the same song once everytime then it stops
local MusicBrick = workspace.MusicPlayer
local Queue = game.ServerStorage.SongQueue
while wait() do
if Queue.S1.Value == "Blank" then -- No songs in queue
local songs = MusicBrick:GetChildren()
while true do
song = songs[math.random(1, #songs)]
repeat wait() until song ~= nil
if song:IsA("Sound") then break end
end
song:Play()
song.Ended:wait()
elseif Queue.S1.Value ~= "Blank" then -- Song in Queue
MusicBrick[Queue.S1.Value]:Play()
local song = MusicBrick[Queue.S1.Value]
Queue.S1.Value = Queue.S2.Value
Queue.S2.Value = Queue.S3.Value
Queue.S4.Value = Queue.S5.Value
Queue.S5.Value = "Blank"
song.Ended:wait()
end
end

9 comments
Are you sure the queue is ever changing?
It shouldnt need to if its blank shouldnt it?
Ah true. Have a print statement after your two .Ended:wait()s to see if that is an issue.
Ahhhhh it doesnt print Ended
But it DOES do it in studio..
It may be true, then, that the .Ended event is not working...I'd check the wiki.
idk, i dont see a reason why it wouldnt work unless i NEED the soundid in the parentheses
heres the page http://wiki.roblox.com/index.php?title=API:Class/Sound/Ended
but if i needed it, it would give me an error saying im missing the parameter, right?