when I run this I want this to keep going even if it errors when it errors when i cant find the Name in Folder

it errors at Test4

but I want it to go to Test5 also

because Test5 is also wrong but it wont print its wrong because it will stop at Test4

local Folder = game.ReplicatedStorage.Folder
-- Folder has Instances inside named
--Hell, Noob, Easy, Value, NOOOOOOOO


local Table = {
	
	Test1 = {Name = 'HELL'},
	Test2 = {Name = 'Noob'},
	Test3 = {Name = 'Easy'},
	Test4 = {Name = 'Scirpting Helper admins suck'}
	Test5 = {Name = 'GUCCIIIII'}
	
}


for i,v in pairs(Table) do 
	
	local Name = v.Name
	
	if Folder[Name] then
		print('Found '..Name)
		
	else
		print('Not Found '..Name)
	end
		
end


-- It errors when it cant find that Name in the folder but I want it to keep going 
-- Because I want it to print everything not found

I found 2 solutions to this use pcall or use FindFirstChild

any other solutions you can give me ?

2 comments

0

You could try doing :WaitForChild(object, 1) which causes the code to check for the object for 1 second and then move on.

0

I agree with test4