Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

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

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

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.

2 comments

0

I think I've made a mistake at line 2 you can fix it for me

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.