StartButton = game.Workspace.StarterGui.Start back = game.Workspace.StarterGui.ScreenGui function MouseClick(Start) Start:Destroy() back:Destroy() end script.Parent.Click:connect(MouseClick)
when you click the StartButton, it destroys the back and the startbutton. But, it won't work! D: Why?
StartButton = game.StarterGUI.ScreenGUI.Start back = game.StarterGUI.ScreenGUI function MouseClick(Start) start:Destroy() back:Destroy() end script.Parent.MouseButton1Click:connect(MouseClick) -- want to return the gui after? well here you have it wait(3) return gui
try this
gui = game.StarterGUI.ScreenGUI-- declare the gui gui.start.MouseButton1Down:connect(function()-- call a function that checks if the button was clicked gui:Destroy()--destroys the whole gui in one shot end)