Hi there! Is there anyway for a for i,v pairs loop to ignore certain things in a folder? Ive been trying to make it where the for i,v pairs loop ignore like a bunch of parts with a same name and ignore the others that arent the same name!
Im not good at coding at all!
So I want the for i,v loop to ignore the parts that say “Part” and not ignore the other parts that say “Close”! Ive made a blacklist script before and the script dosent function at all! Can somebody please help me with this?
> while task.wait() do
> local children = workspace.FolderWork:GetChildren()
> for i,v in pairs(children) do
> if v.Name ~= "Part" then
> print(#workspace.FolderWork:GetChildren())
> end
> end
> end
local function GetChildrenOfName(object, name)
local objects = {}
for _, obj in pairs(object:GetChildren()) do
if obj.Name == name then
table.insert(objects, obj)
end
end
return objects
end
local ignored = {"Part"}
for i,v in ipairs(folder:GetChildren()) do
if not table.find(ignored,v.Name) then
print(v.Name.. "is not ignored!")
else
print(v.name.. "is ignored.")
end
end
local ignored = {"Part"}
local yo = 0
for i,v in ipairs(folder:GetChildren()) do
if not table.find(ignored,v.Name) then
print(v.Name.. "is not ignored!")
yo += 1
else
print(v.name.. "is ignored.")
end
end
print(yo)
Keep in mind this is a While Task.Wait() Do Script
Also there is 8 parts in the folder
local ignored = {"Part"}
local parts = {'Close'}
while task.wait() do
for i,v in ipairs(workspace.FolderWork:GetChildren()) do
if not table.find(ignored,v.Name) then
table.insert(parts,v)
print(#parts)
end
end
end