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?
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?
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.
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
I think I've made a mistake at line 2 you can fix it for me
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.