I think it indexes all the other objects, it finds nothing in that and it prints it. The other and only case is where the TestScript is located, where it doesn’t print at all.
I’m not sure but it may be because if not is only for boolean values (true false) but in this case you are checking if something exists. This wasn’t well explained but it might be the problem.
Your v would be the local script, it would search to find TestScript in your localscript and there is no TestScript inside that’s why it prints that there is nothing called TestScripr
Actually, let’s try diagnose this. Print v within the for loop, because I have no idea what it bumped into. It might have been something added into the folder before it?
for i,v in pairs(TestFolder:GetDescendants()) do
if not v:FindFirstChild("TestScript") then
print("TestScript is Missing")
end
end
While looping through the TestFolder’s descendants, v is going to be the descendant - because TestScript is parented to TestFolder, you’re checking if TestScript has a child named TestScript, which is why it’s not printing anything. I’m fairly sure if you printed v it’d return TestScript
still the same problem and im checking if the TestFolder has a child named TestScript and if the TestFolder has no child named TestScript then it should print the … is missing