Added functionality to layer on top of Roblox's CollectionService
function Class:AddTagToAll(instances, tag)
Adds a tag to all elements in the array of instances
Parameters:
instances
(array<Instance>
)
The instances to tagtag
(string
)
The tag to add
function Class:AddTagsToAll(instances, tags)
Adds a list of tags to all elements in the array of instances
Parameters:
instances
(array<Instance>
)
The instances to tagtags
(array<string>
)
The tags to add
function Class:RemoveTagFromAll(instances, tag)
Removes a tag from all elements in the array of instances
Parameters:
instances
(array<Instance>
)
The instances to untagtag
(string
)
The tag to remove
function Class:RemoveTagsFromAll(instances, tags)
Removes a list of tags to all elements in the array of instances
Parameters:
instances
(array<Instance>
)
The instances to untagtags
(array<string>
)
The tags to remove
function Class:HasTags(instance, tags)
Checks whether a given instance has all the tags provided
Parameters:
instance
(Instance
)
The instance to checktags
(array<string>
)
The tags to look for
Returns:
boolean
True if the instance has all the tags
function Class:GetMutliTagged(tags)
Gets all instances that match the given set of tags
Parameters:
tags
(array<string>
)
The tags to match
Returns:
array<Instance>
The instances that match the set of tags
function Class:GetTaggedChildren(parent, tag)
Gets all children of an instance with a tag
Parameters:
parent
(Instance
)
The parent to search the children oftag
(string
)
The tag to search for
Returns:
array<Instance>
The children that have the tag
function Class:GetTaggedDescendants(ancestor, tag)
Gets all descendants of an instance with a tag
Parameters:
ancestor
(Instance
)
The ancestor to search the descendants oftag
(string
)
The tag to search for
Returns:
array<Instance>
The descendants that have the tag
function Class:GetMultiTaggedChildren(parent, tags)
Gets all children of an instance with all of the given tags
Parameters:
parent
(Instance
)
The parent to search the children oftags
(array<string>
)
The tags to search for
Returns:
array<Instance>
The children that have all the tags
function Class:GetMultiTaggedDescendants(ancestor, tags)
Gets all descendants of an instance with all of the given tags
Parameters:
ancestor
(Instance
)
The ancestor to search the descendants oftags
(array<string>
)
The tags to search for
Returns:
array<Instance>
The descendants that have all the tags
function Class:GetRelativesWithTags(baseInstance, tags, numLevels)
Gets all relatives, not including the top-most ancestor, that match the given set of tags
Parameters:
baseInstance
(Instance
)
The instance to get the relatives oftags
(array<string>
)
The tags to check fornumLevels
(number
)
The number of levels to go up
Returns:
array<Instance>
The relatives that match, not including the baseInstance or the top-most ancestor
function Class:GetChildAddedSignal(parent, tag)
Gets a signal for when a child is added with the given tag to the given parent
Parameters:
parent
(Instance
)
The parent to listen for children oftag
(string
)
The tag to listen for
Returns:
RBXScriptSignal
The signal, will provide the new child as an argument to any handlers connected to it
function Class:GetDescendantAddedSignal(ancestor, tag)
Gets a signal for when a descendant is added with the given tag to the given ancestor
Parameters:
ancestor
(Instance
)
The ancestor to listen for descendants oftag
(string
)
The tag to listen for
Returns:
RBXScriptSignal
The signal, will provide the new descendant as an argument to any handlers connected to it
function Class:GetChildRemovedSignal(parent, tag)
Gets a signal for when a child is removed with the given tag from the given parent
Parameters:
parent
(Instance
)
The parent to listen for children oftag
(string
)
The tag to listen for
Returns:
RBXScriptSignal
The signal, will provide the former child as an argument to any handlers connected to it
function Class:GetDescendantRemovedSignal(ancestor, tag)
Gets a signal for when a descendant is removed with the given tag from the given ancestor
Parameters:
ancestor
(Instance
)
The ancestor to listen for descendants oftag
(string
)
The tag to listen for
Returns:
RBXScriptSignal
The signal, will provide the former descendant as an argument to any handlers connected to it