Achieve
I’m attempting to make a button that removes all the children from certain folders.
Issue
My issue is that this function I made removes items from the folders I tell it not to remove items from
Solutions
I’ve tried using the not
function, using the parents’ name, using the does not equal
sign, I’ve tried moving where the check lies., and so on.
Function
local function RemoveMatches(plr)
local Matchtypes = game:GetService("Workspace").Matchtypes
for _,Folder in pairs (Matchtypes:GetChildren()) do
if Folder.Name ~= "Stages" or Folder.Name ~= "Rings & Extras" or Folder.Name ~= "Main Items" then
for x,Matchtype in pairs (Folder:GetChildren()) do
if Matchtype then
Matchtype:Destroy()
print("Matches Removed.")
end
end
end
end
end
Thank you for any help you can give me.