Please help! My table is not working properly. It keeps saying that '1 is not a valid member of the folder. IDK why it does the. Help!
local Songs = script:FindFirstChild("Songs")
local Gui = game.Lighting:FindFirstChild("ScreenGui")
local Value = 2--change to num songs
while true do
local Clone = Songs:Clone()
Clone.Parent = game:FindFirstChild("Lighting")
repeat
local ChosenSong = Songs[math.random(1,Value)]--This is the part I am having a problem with!
if ChosenSong.Name == "Disco" then
for player, v in pairs(game.Players:GetPlayers()) do
local Guis = player:FindFirstChild("PlayerGui")
local Clone2 = Gui:Clone()
Clone2.Parent = Guis
end
ChosenSong:Play()
wait(ChosenSong.TimeLength)
ChosenSong:Destroy()
for player, v in pairs(game.Players:GetPlayers()) do
local Guis = player:FindFirstChild("PlayerGui")
local Clone2 = Guis:FindFirstChild("ScreenGui")
Clone2:Destroy()
end
Value = Value - 1
else
ChosenSong:Play()
wait(ChosenSong.TimeLength)
ChosenSong:Destroy()
Value = Value - 1
end
until Value == 0
Clone.Parent = script
end

2 comments
Wow thanks!
I actually fixed it lol.