PartTaggingModule lets you tag Instances with string labels and find them later.
Useful for killbricks, checkpoints, doors, and other designer-marked groups.
Available as the global PartTaggingModule.
Overview
Methods
- :AddTag(instance: Instance, tag: string)
- :RemoveTag(instance: Instance, tag: string)
- :HasTag(instance: Instance, tag: string) : bool
- :GetTags(instance: Instance) : List of string
- :GetTagged(tag: string) : List of Instances
Events
- .TagAdded : Event (instance: Instance, tag: string)
- .TagRemoved : Event (instance: Instance, tag: string)
API
Methods
AddTag
AddTag(instance: Instance, tag: string) : void
Adds a tag to the Instance.
Adding the same tag twice does nothing.
PartTaggingModule:AddTag(part, "Killbrick")
RemoveTag
RemoveTag(instance: Instance, tag: string) : void
Removes a tag from the Instance.
HasTag
HasTag(instance: Instance, tag: string) : bool
Returns true if the Instance has the tag.
GetTags
GetTags(instance: Instance) : List of string
Returns every tag on the Instance.
GetTagged
GetTagged(tag: string) : List of Instances
Returns every Instance in the place that currently has the tag.
for _, part in ipairs(PartTaggingModule:GetTagged("Checkpoint")) do
part.Touched:Connect(function(player)
player:SetSpawn(part.Position.X, part.Position.Y, part.Position.Z)
end)
end
Events
TagAdded
TagAdded : Event (instance: Instance, tag: string)
Triggers when a tag is added to an Instance.
TagRemoved
TagRemoved : Event (instance: Instance, tag: string)
Triggers when a tag is removed from an Instance.
