I have recently started ROBLOX Scripting, I am making a music script for my game, simple idea: It will play a sound twice then change the sound id I've tried two scripts:
script.Parent["SONG"].Looped = true -- Keep Songs Repeating
on = true -- do not change
-- DO NOT EDIT --
if on == true then
script.Parent["SONG"].SoundID = script.Parent["SOUND-1"].Value
script.Parent["SONG"]:play()
wait(script.Parent["Song"].TimeLength* 2)
script.Parent["SONG"]:Pause()
script.Parent["SONG"].SoundID = script.Parent["SOUND-2"].Value
script.Parent["SONG"]:Play()
wait(script.Parent["Song"].TimeLength* 2)
script.Parent["SONG"]:Pause()
script.Parent["SONG"].SoundID = script.Parent["SOUND-3"].Value
script.Parent["SONG"]:Play()
wait(script.Parent["Song"].TimeLength* 2)
script.Parent["SONG"]:Pause()
script.Parent["SONG"].SoundID = script.Parent["SOUND-3"].Value
script.Parent["SONG"]:Play()
wait(script.Parent["Song"].TimeLength* 2)
script.Parent["SONG"]:Pause()
script.Parent["SONG"].SoundID = script.Parent["SOUND-4"].Value
script.Parent["SONG"]:Play()
wait(script.Parent["Song"].TimeLength* 2)
script.Parent["SONG"]:Pause()
script.Parent["SONG"].SoundID = script.Parent["SOUND-5"].Value
script.Parent["SONG"]:Play()
end
and
local IDs = {
1236307446,
347962424,
344201558,
155305277,
1456224592
}
local Sound = Instance.new("Sound", script.Parent)
Sound.IsLooped = false
Sound.Volume = 1
while wait() do
for i, v in pairs(IDs) do
Sound.SoundId = "rbxassetid://"..v
Sound.Playing = true
wait(Sound.TimeLength * 2)
end
end
neither scripts have returned any errors, what could I be doing wrong?

1 comment
Works like a charm! Thank you!