local Song1 = game.ReplicatedStorage.BackgroundMusic.Song1:Clone()
local Song2 = game.ReplicatedStorage.BackgroundMusic.Song2:Clone()
local Song3 = game.ReplicatedStorage.BackgroundMusic.Song3:Clone()
local Song4 = game.ReplicatedStorage.BackgroundMusic.Song4:Clone()
local Song5 = game.ReplicatedStorage.BackgroundMusic.Song5:Clone()
local Song6 = game.ReplicatedStorage.BackgroundMusic.Song6:Clone()
local Song7 = game.ReplicatedStorage.BackgroundMusic.Song7:Clone()
local Song8 = game.ReplicatedStorage.BackgroundMusic.Song8:Clone()
local Song9 = game.ReplicatedStorage.BackgroundMusic.Song9:Clone()
local Song10 = game.ReplicatedStorage.BackgroundMusic.Song10:Clone()
local Song11 = game.ReplicatedStorage.BackgroundMusic.Song11:Clone()
local Music = script.MusicisPlaying
local SongNumber = script.Number
while true do
if Music.Value == false then
SongNumber.Value = math.random(1,11)
Music.Value = true
if SongNumber.Value == 1 then
local Song = Song1
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 2 then
local Song = Song2
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 3 then
local Song = Song3
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 4 then
local Song = Song4
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 5 then
local Song = Song5
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 6 then
local Song = Song6
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 7 then
local Song = Song7
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 8 then
local Song = Song8
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 9 then
local Song = Song9
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 10 then
local Song = Song10
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
elseif SongNumber.Value == 11 then
local Song = Song11
Song.Parent = game.Workspace
Song.Playing = true
wait(Song.TimeLength)
Song:Destroy()
end
Music.Value = false
end
wait(0.1)
end
The code appears to be the same for every song and the properties are also the same, but whenever it gets to song 10, it has an error. The other songs work fine until then.

1 comment
The error is specifically "The Parent property of Song10 is locked, current parent: NULL, new parent Workspace" btw