This script is inside a part that detects other parts and see's whether or not the name of the part it's detecting is valid. If the part's name is valid then it will be unanchored and fall through the map. What I'm trying to do is make the script not have any delays when detecting the parts so it'll just check any part and unanchor it quickly. I'm not sure what to do now but if anyone has any suggestions I would really appreciate!
local childList = {}
local Min = 0
while true do
function checkObject(obj)
if (obj ~= script.Parent) and (obj.Name == "Breakable") then
table.insert(childList,obj)
elseif (obj.className == "Model") or (obj == workspace) then
local child = obj:GetChildren()
for x = 1, #child do
if child[x].ClassName == "Model" then
checkObject(child[x])
elseif child[x].Name == "Breakable" then
table.insert(childList,Min,child[x])
end
end
obj.ChildAdded:connect(checkObject)
end
end
checkObject(workspace)
if Min < #childList then
Min = Min + 1
wait()
else
Min = 1
wait()
end
local child = childList[Min]
if (child ~= script.Parent) then
local dis = (child.Position-script.Parent.Position).magnitude
if dis <= 200 then
child.Anchored = false
child.CanCollide = false
table.remove(childList,Min,child)
Min = Min - 1
wait()
end
wait()
end
wait()
end

4 comments
Well, if you removed some of your wait()'s, it would be faster.
I don't know if you'll see this but, the wait()'s are needed for the script to work properly.
Not true, arbitrary wait calls don't properly fix anything
I know they don't fix everything but in this script I need either a waitforchild() somewhere in the script or a normal wait(), I'm not an amazing scripter but I know I atleast need that for the script.