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.
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)