✓ Accepted answer
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:
Children=script.Parent:GetChildren()
for _,Child in pairs(Children) do
if Child:IsA("TextButton") then
Child.MouseButton1Click:connect(function()
end)
end
end
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:
Children={}
for _,Child in pairs(Children) do
if Child:IsA("TextButton") then
Child.MouseButton1Click:connect(function()
end)
end
end
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
4 comments
FUN!
To me, that seems about right. Thanks! I'll try this and if it works, I'll accept your answer.
Works fantastically. Thank you very much, I appreciate it.
Haha, no prob, glad I could help.