Sup! I’m currently working on fixing up this Music queuing system GUI, But so far, it seems to be running into some issues, It plays music just fine since it’s all music from roblox, monstercat, etc
But the problem is that it just repeats the song, you have to manually skip it, and I haven’t been able to figure out how to change it
I’ve tried changing the queue around, and changing tables, etc, but i still can’t figure it out.
I haven’t bothered messing with the gui assets or their code because i don’t think that’s the problem.
local songs = {
{ Name = "Relaxed Scene", Id = "rbxassetid://1848354536" },
{ Name = "Stephen Walking - Glide", Id = "rbxassetid://7028957903" },
{ Name = "Hyper Potions & Nokae - Expedition", Id = "rbxassetid://7023887630" },
{ Name = "Sunset Chill (Bed Version)", Id = "rbxassetid://9046862941" },
{ Name = "Pegboard Nerds & Tokyo Machine - Moshi", Id = "rbxassetid://7024340270" },
{ Name = "Bensley - Vex", Id = "rbxassetid://7023635858" },
{ Name = "Shingo Nakamura - Glow", Id = "rbxassetid://7028856935" },
{ Name = "Glacier - Still", Id = "rbxassetid://7023771708" },
{ Name = "Varien - The Language of Angels", Id = "rbxassetid://7029031068" },
{ Name = "Case & Point - Descender", Id = "rbxassetid://7023650590" },
{ Name = "Shingo Nakamura - Sapporo", Id = "rbxassetid://7028877251" },
{ Name = "Grant - Color", Id = "rbxassetid://7023828725" },
{ Name = "Protostar - New Horizons", Id = "rbxassetid://7028518546" },
{ Name = "Nōpi - Endless Love", Id = "rbxassetid://7024245182" },
{ Name = "Rameses B - Thinking About You", Id = "rbxassetid://7028540590" },
}
local icons = {
Pause = "rbxassetid://6813750293",
Play = "rbxassetid://6813750207",
Mute = "rbxassetid://6813750387",
Volume = "rbxassetid://6813750121",
}
local ORIGINAL_VOLUME = 0.35
local Player = {
CurrentSong = songs[1],
Queue = { table.unpack(songs) },
Paused = false,
Volume = ORIGINAL_VOLUME
}
table.remove(Player.Queue, 1)
local song = script:FindFirstChild("Sound") or script:WaitForChild("Sound")
local gui = script.Parent
local container = gui.Music.Container
local buttons = container.Buttons
buttons.Mute.MouseButton1Click:Connect(function()
Player.Volume = Player.Volume == 0 and ORIGINAL_VOLUME or 0
buttons.Mute.Icon.Image = Player.Volume == 0 and icons.Volume or icons.Mute
end)
buttons.Pause.MouseButton1Click:Connect(function()
Player.Paused = not Player.Paused
buttons.Pause.Icon.Image = Player.Paused and icons.Play or icons.Pause
end)
buttons.Previous.MouseButton1Click:Connect(function()
table.insert(Player.Queue, 1, Player.Queue[#Player.Queue])
song:Stop()
end)
buttons.Next.MouseButton1Click:Connect(function()
song:Stop()
end)
game:GetService("RunService").Heartbeat:Connect(function()
container.Bar.Indicator.Size = UDim2.new(
math.clamp(song.TimePosition / song.TimeLength, 0, 1),
0, 1, 0
)
container.Duration.Text = string.format("%i:%02i - %i:%02i",
math.floor(song.TimePosition / 60), song.TimePosition % 60,
math.floor(song.TimeLength / 60), song.TimeLength % 60
)
song.Playing = not Player.Paused
song.Volume = Player.Volume
end)
while true do
song.SoundId = Player.CurrentSong.Id
container.SongName.Text = Player.CurrentSong.Name
song:Play()
song.Stopped:Wait()
if Player.Queue[1] == Player.Queue[#Player.Queue] then
table.insert(Player.Queue, 2, Player.CurrentSong)
table.remove(Player.Queue, #Player.Queue)
else
Player.Queue[#Player.Queue + 1] = Player.CurrentSong
end
Player.CurrentSong = Player.Queue[1]
table.remove(Player.Queue, 1)
end