I was having trouble while trying to insert background music into my scripting testing game. Here’s the error that pops up when I play the game and the music doesn’t play:
Here’s the code I used:
local one = 5410083912
local two = 5410086218
script.Parent.Sound.Playing=true
while true do
wait()
script.Parent.Sound.SoundId=one
wait(190)
script.Parent.Sound.SoundId=two
wait(150)
end
Yah so that’s just a problem with you’re approach I would to it something more like this…
local SoundObj = Instance.new("Sound",game.Workspace)
local SoundTable = {
5410083912;
5410086218;
}
while true do
for _,v in ipairs(SoundTable) do
SoundObj.SoundId = "rbxassetid://" .. tostring(v);
SoundObj:Play();
SoundObj.Ended:Wait();
end
end
@VineyardVine
Sorry I thought it was the end of the song at the end of that last video I took but if you go to the end you can see that the other one doesn’t start.
Edit: Sorry I forgot it’s so fuzzy but you can see that there in no value for the sound id in that area.
Also, I have 33 robux if you want me to create an item for you to buy, I thought this would be a lot simpler.