im making a script that changes the border color of my gui,but i dont want to make a spam of ipairs because my gui have alot of frames and textbuttons
this is the script i used that works fine (only affects one frame)
Console = script.Parent.Parent.Console
function Red()
for _, child in ipairs(Console:GetChildren())do
if child:IsA("TextButton") then
child.BorderColor3 = Color3.new(255,0,0)
end
end
end
i tried this but it dint work
Console = script.Parent.Parent.Console
Music = script.Parent.Parent.Music
Gears = script.Parent.Parent.Gears
stuff = {Console,Music,Gears}
function Red()
for _, child in ipairs(stuff:GetChildren())do
if child:IsA("TextButton") then
child.BorderColor3 = Color3.new(255,0,0)
end
end
end

1 comment
No easy way that I know of. However Pyrondon made this: https://forum.scriptinghelpers.org/topic/15/iterator-generator-for-multiple-tables/3