Scripting multiple songs

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I was just making a multiple song script for my game but when I run the game this error pops up what does it mean?

  2. What is the issue? Include screenshots / videos if possible!
    Screenshot (372)

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    I tried looking for solutions on youtube didn’t find any

thank you in advance.

Can you post your script so we can help you?

2 Likes

this is the script
local sound1 = id here
local sound2 = id here
local sound3 = id here
local sound4 = id here – of course that’s not what I put in the script I just don’t wanna show the ids
local sound5 = id here
local sound6 = id here
local sound7 = id here
local Music = game.Workspace.Music
wait(5)
while true do
Music.SoundId = “rbxasset://”…sound1
Music:Play()
Music.Ended:wait(122)
wait()
Music.SoundId = “rbxasset://”…sound2
Music:Play()
Music.Ended:wait(56)
wait()
Music.SoundId = “rbxasset://”…sound3
Music:Play()
Music.Ended:wait(54)
wait()
Music.SoundId = “rbxasset://”…sound4
Music:Play()
Music.Ended:wait(56)
wait()
Music.SoundId = “rbxasset://”…sound5
Music:Play()
Music.Ended:wait(105)
wait()
Music.SoundId = “rbxasset://”…sound6
Music:Play()
Music.Ended:wait(240)
wait()
Music.SoundId = “rbxasset://”…sound7
Music:Play()
Music.Ended:wait(96)
wait()

end

Please put your code in a code block next time.

To concatenate two strings, it is two dots, not three dots.

There are also a few things you can change in your script:

  • You can put all of your ids in an array and loop over the array. You do not need to create a variable for every id.
  • It is rbxassetid://, not rbxasset://.
  • Event:Wait() has no parameters.
1 Like