sorry i just need it for my game
GUIVariable.MouseButton1Click:Connect(function() for _, gui in pairs(GuiVariable.Parent:GetChildren()) do if gui ~= script then gui.Enabled = true end end
By using a for loop, the gui
variable is gonna change its property Enabled
(if...it has it.). If it's not the script, then it will run. Hope this helps.
If you are talking about gui you made yourself, make a button and put a LocalScript
in it and create a ScreenGui
and call it AlwaysVisibleScreenGui
and put a button in it so this script will not hide frames like hide/unhide frames button
local isEnabled = true local plrGui = game:GetService("Players").LocalPlayer.PlayerGui -- a folder of all gui, only visible when the game is running, located in a player's folder local alwaysVisibleGuiScreen = plrGui:WaitForChild("AlwaysVisibleScreenGui") -- A screen gui which will be always visible local button = script.Parent button.MouseButton1Click:Connect(function() local screenGuis = plrGui:GetChildren() -- an array of all gui screens at the moment if isEnabled then isEnabled = false else isEnabled = true end -- changing a variable to determain whenever all gui are visible or not for i, v in pairs(screenGuis) do if v:IsA("ScreenGui") and v ~= alwaysVisibleGuiScreen then v.Enabled = isEnabled end end end)
If you wish to hide all frames (even the ones made by roblox), add this line somewhere in a function: game.StarterGui:SetCoreGuiEnabled(Enum.CoreGuiType.All, isEnabled)
. If you have any questions, ask them in the comments
Closed as Not Constructive by JesseSong
This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.
Why was this question closed?