function Util.MakeFuzzyFinder(F)local O local e={}if typeof(F)=="\069\110\117\109"then F=F:GetEnumItems()end if typeof(F)=="\073\110\115\116\097\110\099\101"then O,e=transformInstanceSet(F:GetChildren())elseif typeof(F)=="\116\097\098\108\101"then if typeof(F[1])=="\073\110\115\116\097\110\099\101"or typeof(F[1])=="\069\110\117\109\073\116\101\109"or typeof(F[1])=="\116\097\098\108\101"and typeof(F[1].Name)=="\115\116\114\105\110\103"then O,e=transformInstanceSet(F)elseif type(F[1])=="\115\116\114\105\110\103"then O=F elseif F[1]~=nil then error("\077\097\107\101\070\117\122\122\121\070\105\110\100\101\114 \111\110\108\121 \097\099\099\101\112\116\115 \116\097\098\108\101\115 \111\102 \105\110\115\116\097\110\099\101\115 \111\114 \115\116\114\105\110\103\115\046")else O={}end else error("\077\097\107\101\070\117\122\122\121\070\105\110\100\101\114 \111\110\108\121 \097\099\099\101\112\116\115 \097 \116\097\098\108\101\044 \069\110\117\109\044 \111\114 \073\110\115\116\097\110\099\101\046")end return function(F,h)local Q={}for O,m in pairs(O)do local A=e and e[O]or m if m:lower()==F:lower()then if h then return A else table.insert(Q,1,A)end elseif(m:lower()):sub(1,#F)==F:lower()then Q[#Q+1]=A end end if h then return Q[1]end return Q end end

function Util.MakeFuzzyFinder(setOrContainer)
	local names
	local instances = {}

	if typeof(setOrContainer) == "Enum" then
		setOrContainer = setOrContainer:GetEnumItems()
	end

	if typeof(setOrContainer) == "Instance" then
		names, instances = transformInstanceSet(setOrContainer:GetChildren())
	elseif typeof(setOrContainer) == "table" then
		if
			typeof(setOrContainer[1]) == "Instance" or typeof(setOrContainer[1]) == "EnumItem" or
				(typeof(setOrContainer[1]) == "table" and typeof(setOrContainer[1].Name) == "string")
		 then
			names, instances = transformInstanceSet(setOrContainer)
		elseif type(setOrContainer[1]) == "string" then
			names = setOrContainer
		elseif setOrContainer[1] ~= nil then
			error("MakeFuzzyFinder only accepts tables of instances or strings.")
		else
			names = {}
		end
	else
		error("MakeFuzzyFinder only accepts a table, Enum, or Instance.")
	end

	-- Searches the set (checking exact matches first)
	return function(text, returnFirst)
		local results = {}

		for i, name in pairs(names) do
			local value = instances and instances[i] or name

			-- Continue on checking for non-exact matches...
			-- Still need to loop through everything, even on returnFirst, because possibility of an exact match.
			if name:lower() == text:lower() then
				if returnFirst then
					return value
				else
					table.insert(results, 1, value)
				end
			elseif name:lower():sub(1, #text) == text:lower() then
				results[#results + 1] = value
			end
		end

		if returnFirst then
			return results[1]
		end

		return results
	end
end
