There actually is a pretty simple way of doing this with a loop. If they all have the same parent, then you could easily just do it this way:
1 | Children = script.Parent:GetChildren() |
3 | for _,Child in pairs (Children) do |
4 | if Child:IsA( "TextButton" ) then |
5 | Child.MouseButton 1 Click:connect( function () |
Anyways, this would be the simplest way of doing it. Another way however if they don't have the same parent would be to do this:
3 | for _,Child in pairs (Children) do |
4 | if Child:IsA( "TextButton" ) then |
5 | Child.MouseButton 1 Click:connect( function () |
Anyways, I hope this helped you out a bit. If you have any further problems/questions, please leave a comment below, and I'll see what I can do :P