I have this gui script after I open it and close it, when I try to open it the 2nd time it didn't work. What do I need to do to fix it?
function boop(Player) if not Player.PlayerGui:FindFirstChild("Gui") then local gui = script.Gui:clone() gui.Parent = Player.PlayerGui gui.LocalScript.Disabled = false end end script.Parent.ClickDetector.MouseClick:connect(boop)
Question, does the local script when you close that GUI remove the whole GUI from the PlayerGui or does it make the Frames Visible false? If so then simply make it were you add:
function boop(Player) if not Player.PlayerGui:FindFirstChild("Gui") then local gui = script.Gui:clone() gui.Parent = Player.PlayerGui gui.LocalScript.Disabled = false elseif Player.PlayerGui:FindFirstChild("Gui") then Player.PlayerGui:FindFirstChild("Gui").LocalScript.Disabled = true Player.PlayerGui:FindFirstChild("Gui").LocalScript.Disabled = false Player.PlayerGui:FindFirstChild("Gui").*NAME OF FRAME*.Visible = true end end script.Parent.ClickDetector.MouseClick:connect(boop)