The title might not have made sense. But I am working on a script whichwill behave to folders' parents and children. The code is supposed to make a gui for each folder it finds, but It only does the children of the base folder. Any help please? Code:
function getItems(obj)
for _,v2 in pairs(obj:GetChildren()) do
if v2:IsA("ModuleScript") then
v2:Clone().Parent = obj
elseif v2:IsA("Folder") then
local otherclone = moduleTemplate:Clone()
otherclone.Name = v2.Name
pcall(function() otherclone.Text = v2.Name end)
otherclone.Parent = obj
otherclone.MouseButton1Click:Connect(function()
local category = gui.Categories.PG1:Clone()
category.Parent = gui.Categories
category.Title.Text = v.Name
category.Name = v.Name
for _,v in pairs(category.Items:GetChildren()) do
if v:IsA("TextButton") then
v:Destroy()
end
end
getItems(category)
swipe(gui.Categories.PG1,category)
end)
getItems(v2)
else
end
end
end
getItems() -- there was a parameter passed in, but I decided to remove it here
If anyone knows the solution, please reply. Thanks, PoWerofThEePg

1 comment
Thank you! I will use this in my code.