Skip to content

gaymeowing/finder

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Finder

Find Instances with conditions, and perform actions on them!

API Reference

Finder.find(target: {Instance}, condition: Condition, behavior: Behavior?): {Instance}|any?

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.

Finder.addTemplate(category: string, name: string, condition: Condition): boolean

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.

Finder.getTemplate(category: string, name: string): Condition

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.

Template treeview

local Finder = {
    Templates = {
        CategoryName = {
            TemplateName: Condition = function(value: any, object: Instance): boolean
                return object ~= nil
            end
        }
    }
}

Types

export type Condition = (value: any, object: Instance) -> (boolean)
export type Behavior = (result: {Instance}) -> ()

About

No description, website, or topics provided.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages