Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to listen to events of tagged item ? [closed]

Asked by 5 years ago
local collect = game:GetService("CollectionService")
local parts = {}
local counter = 1

 for i, v in pairs(script.Parent:GetChildren()) do
    if v:IsA("BasePart") then
        table.insert(parts,counter,v.Name)
        counter=counter+1
        collect:AddTag(v,"Damage")
    end
end

local tagged = collect:GetTagged("Damage")
collect:HasTag(tagged, "Damage").Touched:connect(function(q)
    print("HDH")
end)

Closed as Too Broad by User#19524

This question has been closed because it is too broad and is generally unanswerable. Please ask a more specific question.

Why was this question closed?