I am using a for loop to insert each animation into a table.
local Assets = game:GetService("ReplicatedStorage"):WaitForChild("Assets")
local Street = {}
for _, Folder in pairs(Assets.Animations:GetChildren()) do
for _, Animation in pairs(Folder:GetChildren()) do
if Animation.Name:find("StreetA") then
table.insert(Street, Animation)
end
end
end
print(Street)
They are not being inserted in the order that they are in the folder.
They are sorted in the order I want. The problem is, when the for loop takes what’s in the folder and iterates them into a table, they come out random.
local Assets = game:GetService("ReplicatedStorage").Assets
local Street ={}
for _, Folder in Assets:GetChildren() do
for i = 1, #Folder:GetChildren() do
for _, Animation in Folder:GetChildren() do
if Animation.Name:find("StreetA"..i) then
table.insert(Street, Animation)
end
end
end
end
print(Street)