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

How do I make it where when you click a GUI the rest are removed?

When people click a GUI I want the others to go away.

2 comments

0

Could you explain a little more? Like what GUI's would go away.

0

All GUIs.

1 answer

The code to remove all other GUI's when you click on a button would be :

This code would be put in a LocalScript

keep = gui

button.MouseButton1Click:connect(function()
	for _,v in pairs(game:GetService("Players").LocalPlayer.PlayerGui) do
		if v ~= keep then
			v:Destroy()
		end
	end
end)

You have to define two things : keep : The GUI that the button is or just the one you don't want to be removed. button : The button you have to click to remove all the other GUI's

If you have any questions, concerns or just need some help with this PM me on ROBLOX!

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