Find Instances with conditions, and perform actions on them!
Performs a search on the specified Instances with the condition
, returns a table of Instances if the condition
returned true.
If behavior
is supplied, returns the result from behavior
.
Adds a new template to Finder with the specified category and name. If the name exists in the specified category already, Finder will not add the template and returns false
with a warn.
If the specified category does not exist, Finder will create the category manually.
Returns the specified template. If the category or the template name does not exist in the specified category, returns a dummy Condition
that returns false
, with a warn.
local Finder = {
Templates = {
CategoryName = {
TemplateName: Condition = function(value: any, object: Instance): boolean
return object ~= nil
end
}
}
}
export type Condition = (value: any, object: Instance) -> (boolean)
export type Behavior = (result: {Instance}) -> ()