So far I have gotten a gui to open and to close but I have a problem. The script I used to open the gui doesn't work with my close script. My open script is
local clickDetector = script.Parent
local brickClickedEvent = game.ReplicatedStorage.Events.BrickClicked
local debounce = false
clickDetector.MouseClick:Connect(function(player)
if not debounce then
debounce = true
brickClickedEvent:FireClient(player)
wait(1)
debounce = false
end
end)
That works all fine and dandy until I try to close it. My close script is
script.Parent.ClickDetector.MouseClick:Connect(function(player)
player:WaitForChild("PlayerGui").ScreenGui.Frame.Visible = true
end)
How would I make it so that these two scripts work together and allow me to both open and close?

1 comment
Also tip, put your code in the squiggly line button thing these ~~