I'm trying to get this to play another song when the first song ends, but I keep getting "ending song" spammed in the output.
repeat wait() until script.Ignore
--Playlist
Songs = {234174567,245311593,175588117,152208064} --there are more songs but too many for sh
--Variables
local Audio = script.Parent.Speakers:GetChildren()
local cont = false
mainspeaker = script.Parent.Speakers.MainSpeaker.Sound
while true do
local randomize = Songs[math.random(1, #Songs)]
cont = false
-- script.Ignore.Previous.Value = Audio.MainSpeaker.Sound.SoundId
for i = 1, #Audio do
Audio[i].Sound.SoundId = "rbxassetid://"..randomize
end
if mainspeaker.SoundId == script.Ignore.Previous.Value then
repeat wait(.5) mainspeaker.SoundId = "rbxassetid://"..randomize until mainspeaker.SoundId ~= script.Ignore.Previous.Value
end
for i = 1, #Audio do
Audio[i].Sound:Play()
end
for i = 1, #Audio do
for c = 0,1,.1 do
Audio[i].Sound.Volume = c
end
end
cont = true
local tim = mainspeaker.TimeLength - 5
wait(tim)
print("ending song")
for i = 1, #Audio do
for c = 1,0,-.1 do
Audio[i].Sound.Volume = c
end
end
end
