Best way to find a tool without looping through their backpack?

I’m trying to find a specific tool name which contains numbers, but not sure how I can do that without looping through their backpack and character.

local Find = Backpack:find('%d') or Character:find('%d')

This would be invalid, of course, but an example.

Maybe this? Instance:FindFirstChild

I don’t know what to search for inside that, since I won’t know the tool name.

You could use :FindFirstChildWhichIsA(“Tool”), which would return a tool. I recommend not giving the tool a name that you don’t know, as with this it will return the first tool that it finds if there are multiple tools.

Yes, it would return a tool, but I need to search for a tool which contains a number.

Then looping through them is the only option, which is probably fine since findfirstchild likely uses a loop anyways. Here’s a loop that should work:

local function example(location)
	for i,v in pairs(location:GetChildren()) do
		if v:IsA("Tool") then
			if string.match(v.Name, "%d") then
				return v
			end
		end
	end
end

local tool = example(Backpack) or example(Character)