So I have a bunch of buttons right now, and this is what I have to connect the same function to each of them:
for _, button in pairs (buttons:GetChildren()) do
if button:IsA("TextButton") then
button.MouseEnter:connect(function()
button.TextSize = 21
end)
button.MouseLeave:connect(function()
button.TextSize = 20
end)
button.MouseButton1Down:connect(function()
animateTopBarButtons(button)
end)
end
end
Is this the best way to do this, or should I connect each button separately? (which will take up a ton of lines)

1 comment
Alright, thanks. Having it in a for loop looks ugly to me, but I guess I'll have to keep it like that.