function t.instanceIsA(G,R)assert(t.string(G))local d if R~=nil then d=t.children(R)end return function(R)local q,E=t.Instance(R)if not q then return false,E or""end if not R:IsA(G)then return false,string.format("\037\115 \101\120\112\101\099\116\101\100\044 \103\111\116 \037\115",G,R.ClassName)end if d then local G,q=d(R)if not G then return false,q end end return true end end
--[[**
	ensure value is an Instance and it's ClassName matches the given ClassName by an IsA comparison

	@param className The class name to check for

	@returns A function that will return true iff the condition is passed
**--]]
function t.instanceIsA(className, childTable)
	assert(t.string(className))

	local childrenCheck
	if childTable ~= nil then
		childrenCheck = t.children(childTable)
	end

	return function(value)
		local instanceSuccess, instanceErrMsg = t.Instance(value)
		if not instanceSuccess then
			return false, instanceErrMsg or ""
		end

		if not value:IsA(className) then
			return false, string.format("%s expected, got %s", className, value.ClassName)
		end

		if childrenCheck then
			local childrenSuccess, childrenErrMsg = childrenCheck(value)
			if not childrenSuccess then
				return false, childrenErrMsg
			end
		end

		return true
	end
end
