I'm stuck trying to make this happen. I'm making a virtual PC in ROBLOX, but I'm not sure how to make a TextButton so when it is clicked, open up a new frame and close the older frame. Anyone have an idea?
✓ ANSWER ACCEPTED
How do I make a button on a surface GUI open a new Frame?
1 answer
✓ Accepted answer
If you are asking for a simple Open and Close function for a gui here it is
local openFrame = script.Parent.YourOpenFrame -- frame wanted to open
local closeFrame = script.Parent.YourCloseFrame -- frame wanted to close
local db = true -- set debounce
script.Parent.MouseButton1Click:Connect(function()
if not db then -- if debounce is not true
return
end
db = false
closeFrame.Visible = false
openFrame.Visible = true
wait(1)
db = true
end)
This opens the wanted frame and closes the other frame
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
One way you could try, is to have the GUI in Startergui, and setting the Adornee rather than scripting it straight onto the part: http://wiki.roblox.com/index.php?title=API:Class/SurfaceGui/Adornee