I'm trying to make background music play, and it's not getting the children of the folder, "Music" which contains the songs. I used the function I made, nothing happened. I tried to print the songs. Nothing happened. Help please!
local Songs = script.Parent.Music:GetChildren()
print(Songs)
local function PlaySongs()
for i, v in pairs(Songs) do
v:Play()
while v.Playing == true do
wait()
end
end
end
PlaySongs()
script.Parent.Music.MiiMusic.Played:Connect(function()
PlaySongs()
end)

7 comments
What type of script is this? Where is it located? Also, you're not calling the function.
ok, yk the function isn't called so obviously nothing happens.
And also it's inefficient to use v.Playing = true, it's much better to do v:Play()
I did call it, this is only a portion of the script. But I suppose I should send the whole thing.
It's a normal script inside the server storage. That my be the problem, but I'll wait for an answer to give a person reputation
Printing a table does not work either. GetChildren() returns a table, and you tried printing that table. Try doing print(Songs[1])
Oh thanks! Post It as an answer so I can mark it.