How would i go about getting the activated click detectors name

How would I go about running the same function on multiple click detectors and determining what click click detector was activated like so below?

local parts = model.Activators:GetChildren()
for a, b in ipairs(parts) do
	if b:FindFirstChild("ClickDetector") then
		b.ClickDetector.MouseButton1Click:Connect(function(plyr)
			
			print(plyr.Name.." clicked the click detector inside of "..activated click detectors name)
			
		end)
		
	end
	
end

Hey!

If I’m right, the activated ClickDetector | Roblox Creator Documentation should be b.ClickDetector, so the activated name of it is b.ClickDetector.Name or am I wrong?

1 Like