Luduvo Contents
Theme
On this page

Tags

marks entities with named tags and finds every entity with that tag

Methods

5 members Access: shared

Add(entity: Instance, tag: string) -> ()

add a tag to an entity

Parameters
NameTypeDescription
entityInstanceEntity to assign the tag to.
tagstringName of the tag to assign.
returns()—
Find(tag: string) -> {Instance}

find all entities with a tag

Parameters
NameTypeDescription
tagstringName of the tag to search for.
returns{Instance}—
Get(entity: Instance) -> {string}

list tags on an entity

Parameters
NameTypeDescription
entityInstanceEntity whose assigned tags to return.
returns{string}—
Has(entity: Instance, tag: string) -> boolean

check whether an entity has a tag

Parameters
NameTypeDescription
entityInstanceEntity to check for the tag.
tagstringName of the tag to test.
returnsboolean—
Remove(entity: Instance, tag: string) -> ()

remove a tag from an entity

Parameters
NameTypeDescription
entityInstanceEntity to detach the tag from.
tagstringName of the tag to remove.
returns()—

Tagging Entities for Group Queries

Lifecycle: Server

Tags are string labels you can add, test, search, and remove without writing a component.

Luau
local chest = game.Prefabs.Spawn("TreasureChest")if chest then	game.Tags.Add(chest, "Interactable")	if game.Tags.Has(chest, "Interactable") then		local items = game.Tags.Find("Interactable")		print("Found interactable entities:", #items)	end	game.Tags.Remove(chest, "Interactable")end
Output: Found interactable entities: 1