I lastly tried searching for some tutorials on how to make button that closes or make all buttons in experience disappear when clicked. But i was not able to find any.
And I totally suck at scripting too, which means i don’t have any other option than trying to ask you guys here.
Basically everything i want is just a button that would close all buttons when touched and show the buttons again if touched again.
local button = script.Parent
local buttonGui = button.Parent
local player = game.Players.LocalPlayer
local playerGui = player:WaitForChild(“PlayerGui”)
local guiStates = {}
local guisVisible = true
button.MouseButton1Click:Connect(function()
guisVisible = not guisVisible
for _, gui in pairs(playerGui:GetChildren()) do
if gui:IsA("ScreenGui") and gui ~= buttonGui then
if guisVisible then
gui.Enabled = guiStates[gui] or false
else
guiStates[gui] = gui.Enabled
gui.Enabled = false
end
end
end