What's the best way to connect a function to a bunch of text buttons?
So I have a bunch of buttons right now, and this is what I have to connect the same function to each of them:
01 | for _, button in pairs (buttons:GetChildren()) do |
02 | if button:IsA( "TextButton" ) then |
03 | button.MouseEnter:connect( function () |
07 | button.MouseLeave:connect( function () |
11 | button.MouseButton 1 Down:connect( function () |
12 | animateTopBarButtons(button) |
Is this the best way to do this, or should I connect each button separately? (which will take up a ton of lines)