I’m trying to add a tag using collection services.
How do I do this.
This is what I have
local cs = game:GetService('CollectionService')
cs:AddTag(Obj)
I just need to figure out how I add the tag part I got the object.
I’m trying to add a tag using collection services.
How do I do this.
This is what I have
local cs = game:GetService('CollectionService')
cs:AddTag(Obj)
I just need to figure out how I add the tag part I got the object.
To Add tags, you need:
CollectionService
to know what you want to taglocal cs = game:GetService('CollectionService')
cs:AddTag(Instance, "myTag")
here, you have a tag called myTag
assigned to an Instance
If you have multiple Objects under the same tag (aka myTag
) , you could do this:
for num, Items in pairs(cs:GetTagged("myTag")) do -- Iterates through Objects with Tag
-- You are able to edit multiple Objects under this tag
end
To Remove a Tag, you would do the same as AddTag
:
cs:RemoveTag(Instance, "myTag")
This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.