Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Music Script only plays 1 song?

Asked by 8 years ago

Only plays one song then stops.

    repeat
    Assets = {"319758951","130775431","313694441","399781334","160272588","155319906","143204341","362605449","254695481","188712851"}
    CurrentSong = game.Workspace.Music.SurfaceGui.TextLabel
    Song = Instance.new("Sound", game.Workspace)
    Song.Volume = .15
    Song.Looped = false
    Song.SoundId = "http://www.roblox.com/asset/?id="..Assets[math.random(1,#Assets)]

if Song.SoundId == "http://www.roblox.com/asset/?id=319758951" then
    Song:Play()
    CurrentSong.Text = "Flo Rida - My House"
    wait(117)
    CurrentSong.Text = "[Selecting Song]"

elseif Song.SoundId == "http://www.roblox.com/asset/?id=399781334" then
    Song:Play()
    CurrentSong.Text = "Drake - One Dance ft. Wizkid & Kyla"
    wait(117)
    CurrentSong.Text = "[Selecting Song]"


elseif Song.SoundId == "http://www.roblox.com/asset/?id=130775431" then
    Song:Play()
    CurrentSong.Text = "Epic Sax Guy C:"
    wait(12)
    CurrentSong.Text = "[Selecting Song]"


elseif Song.SoundId == "http://www.roblox.com/asset/?id=160272588" then
    Song:Play()
    CurrentSong.Text = "Iggy Azalea - Fancy"
    wait(117)
    CurrentSong.Text = "[Selecting Song]"


elseif Song.SoundId == "http://www.roblox.com/asset/?id=313694441" then
    Song:Play()
    CurrentSong.Text = "Adele - Hello"
    wait(120)
    Song:Stop()
    CurrentSong.Text = "[Selecting Song]"

elseif Song.SoundId == "http://www.roblox.com/asset/?id=143204341" then
    Song:Play()
    CurrentSong.Text = "Katy Perry - Dark Horse ft. Juicy J"
    wait(120)
    CurrentSong.Text = "[Selecting Song]"

elseif Song.SoundId == "http://www.roblox.com/asset/?id=155319906" then
    Song:Play()
    CurrentSong.Text = "Ariana Grande - Problem ft. Iggy Azalea"
    wait(120)
    CurrentSong.Text = "[Selecting Song]"

elseif Song.SoundId == "http://www.roblox.com/asset/?id=362605449" then
    Song:Play()
    CurrentSong.Text = "DNCE - Cake by the Ocean"
    wait(120)
    CurrentSong.Text = "[Selecting Song]"

elseif Song.SoundId == "http://www.roblox.com/asset/?id=188712851" then
    Song:Play()
    CurrentSong.Text = "Walk the Moon - Shutup and Dance"
    wait(120)
    CurrentSong.Text = "[Selecting Song]"

elseif Song.SoundId == "http://www.roblox.com/asset/?id=254695481" then
    Song:Play()
    CurrentSong.Text = "OMI - Cheerleader"
    wait(80)
    CurrentSong.Text = "[Selecting Song]"

end
Song:Stop()
Song:Destroy()
until game.Workspace.Name == "LOL HI"
2
This works 100% for me, it may be a delay when roblox loads the asset in. Have you pre-loaded the asset? Also i would re-think this code to simplify it. Hint:- table to hold song and other info, a dedicated play function andIsPlaying. User#5423 17 — 8y
0
It works fine in studio but not in the actual game.. :/ Mikel5656 2 — 8y

Answer this question