I'm trying to write a simple script for looping through a folder that I have located in Workspace filled with music. Here's my current code:
music = game.Workspace.Music:GetChildren()
while true do
for i, tune in pairs(music) do
wait(1)
tune:Play()
wait(tune.TimeLength + 1)
end
end
However, the music is not loaded on the server, it is loaded on the client. So when I attempt to get the music's TimeLength, it returns a 0. How can I get the desired effect in the most efficient way possible? Thanks in advance.

6 comments
Have you tried adding a 'repeat' loop to wait until the 'TimeLength' value is not congruent to 0? Probably not the best way, but it's as best I can think of atm. :)
@TheAlphaStigma That wouldn't help. TimeLength is always = to nil or 0 on the server. You have to check the sound's length on the client.
@Sporkyz Dang, I never knew that. :/
How is it on the client? It's on the server the music is located in Workspace. Alright well anyways is FE on? Where is this script located and what kind of script is it? FE = Filtering Enabled btw.
Sounds load locally, but the music is located in Workspace. FilteringEnabled is not on, and FE is not the problem. Again, it is because it loads locally that I'm having trouble.
There is a sound ended event. Call that when the sound ends and then start the next song. You don't even need a loop. Simply initiate the first song and the next song should begin as the last ended.