Search+
Expanded Instance SearchingOverview
Search+ is a module I designed to do one simple task: extend on the default LuaInstance
functions (e.g. Instance:GetChildren
). They work well enough for most cases, but what if they just don't cut it?
Search+ is a module designed to do just that: supplement the built-in searches with things such as GetChildrenWithTag
, FindFirstDescendantWithTag
, and more. All documentation is provided in this post.
Module & Installation
The module can be found here,local SearchPlus = require(6715385532)
Documentation
function SearchPlus:GetDescendantsWithTag(instance, tag)
Parameters:
- instance
Instance
: the Instance Search+ will search.- tag
string
: the CollectionService tag to use.Returns:
result
: an Array containing all theInstances
that have the passed tag and descend from the provided Instance.
function SearchPlus:GetChildrenWithTag(instance, tag)
Parameters:
- instance
Instance
: the Instance Search+ will search.- tag
string
: the CollectionService tag to use.Returns:
result
: an Array containing all the Instances that have the passed tag and are direct children from the provided Instance.
function SearchPlus:FindFirstChildWithTag(instance, tag)
Parameters:
- instance
instance
: the Instance Search+ will search in.- tag
string
: the CollectionService tag to use.Returns:
- result
Instance
: the first Instance that is a direct child of the provided Instance and has the passed tag. If none are found, returnsnil
.
function SearchPlus:FindFirstDescendantWithTag(instance, tag)
Parameters:
- instance
Instance
: the Instance Search+ will use.- tag
string
: the CollectionService tag to use.Returns:
- result
Instance
: the first Instance that is descended from the provided Instance and has the passed tag. If none are found, returnsnil
.
Changelog
V1.00
Initial release, with 4 functions.Thank you for reading, and I hope you find this useful!
- 1
- 2
- 3
- 4
- 5
0 voters