How to set function return class?

Hello, everyone!
Currently I am trying to make my code look beautiful: I am trying to set classes for arguments in functions.
But, I don’t know how to set class for return value from function? So instead of it would return (for example) .
Here is the function:

local function ScanForItems(model: Instance,class: string)
	local items = {}
	for i,v in pairs(model:GetDescendants()) do
		if v:IsA(class) then
			table.insert(items,v)
		end
	end
	return items
end
2 Likes

you can set it at the end of the definition, like so:

local function ScanForItems(model: Instance,class: string): {any: any}

The “{any: any}” means a table with any type of keys and any type of value

2 Likes

Oh wow, thanks, that looks thicc

1 Like