Invalid key to 'next'

Can you try rewriting your code like this?

local songs = {}
for i, song in pairs(Group:GetChildren()) do
   table.insert (songs, song)
end

local CurrentSound = next(songs, nil)
Skip.MouseButton1Click:Connect(function()
	CurrentSound.Playing = false
	next(songs,CurrentSound).Playing = true
end)
1 Like