I had this question for a while now, I went ahead and made a working script that does the job that I want it to do, but the problem is that it is in a loop. So everytime you press one of the buttons, the game lags for a bit, and it does what I want it to more than once, so its very annoying. I was wondering if anyone knew any other ways. Heres what I pretty much used:
while wait() do
for i, v in pairs(youdontneedtoknowthislol:GetChildren()) do
if v:IsA("ImageButton") then
v.MouseButton1Click:connect(function()
--the thing i want it to do
end)
end
end
end
thanks a lot! I appreciate any help.

1 comment
Yes, I have tried putting a small wait time on there, but it still loops a ton and lags.