So basiclly i have a gui that will automatically added new TextButton in a ScrollingFrame
and i use GetDescendants() to get all the button, but the problem is that it get all the button before the other script can add the TextButton in.
So i need some way get all the new TextButton that just got added. Maybe a way to loop GetDescendants()
I have tried to loop it but still doesn’t work
while wait() do
button = script.Parent.Main:GetDescendants()
for i,v in pairs(button) do
if v:IsA("TextButton") then
v.MouseButton1Click:Connect(function()
-- Check what button is and fire some RemoveEvent
end
i tried to loop it with the for…do… loop but it fire the RemoteEvent like 20 times a sec cause my game to lag.