How to set event to be detected by variety of objects

I have a game with well over 100 buttons. Do I have to add

script.Parent.Button.Activated:Connect(function()

end)

over 100 times or can I just do something like onButtonClick and broadcast the button’s name so I know which one is handleing the event?

you could do

for _,d in pairs(buttonFrame:GetDecsendants()) do
If d:isA(‘TextButton’) then
d.MouseButton1Click:Connect(function()
print(d.Name)
end)
end
end