Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

How to make simple & short script for a bunch of Guis?

Asked by 6 years ago
Edited 6 years ago

I have like 22 Parts and each one has 1 ScreenGui that has Two ImageLabels on it. **I am planning to change all the ImageLabel Images with a single button at once. **

Is there a possible way to make the script simple and short?

1 answer

Log in to vote
0
Answered by 6 years ago

Try grouping the buttons as many as possible in a Frame in order for this to work:

for i,v in pairs(Frame:GetChildren()) do
    if v IsA('TextButton') then
        v.MouseButton1Click:connect(function()
            --Do your stuff
        end)
    end
end

I hope.

0
I think I've made a mistake at line 2 you can fix it for me magicguy78942 238 — 6y
0
I have like 22 Parts and each one has 1 ScreenGui that has Two ImageLabels on it. I can't combine all ImageLabels since the location will be different. User#15070 0 — 6y
Ad

Answer this question