When people click a GUI I want the others to go away.
COMMUNITY QUESTION
How do I make it where when you click a GUI the rest are removed?
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.

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