I'm trying to make a random music player script. I'm adding more songs but here is what I've got for now. What do I have to fix and or what did I do wrong?
title = game.StarterGui.He.Box.Song
function Playsong()
local number = math.random(1,2)
if number == 1 then
script.Sound1:Play()
title.Text = "Hate Me"
wait(15)
script.Sound1:Stop()
title.Text = "No Song Playing"
wait(3)
title.Text = "Loading Song"
wait(3)
Playsong()
else if number == 2 then
script.Sound2:Play()
title.Text = "Stitches"
wait(120)
script.Sound2:Stop()
title.Text = "No Song Playing"
wait(1)
title.Text = "Loading Song"
wait(1)
Playsong()
end
end
end
Playsong()

1 comment
elseif should not have a space in it