Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Gui buttons

I need help with guis button scripts When click the button

function mousebutton1down (click)

to open the gui and then i need a close button

button:remove()

Thanks if you can help

3 comments

0

What exactly do you need ? Be more precise please.

0

Please do not spam tags. Thanks!

0

i didnt spam tags... i only put one

1 answer

✓ Accepted answer
local frame = ... -- Be sure to replace these two with proper variables.
local button = ... 
button.MouseButton1Down:connect(function()
  if frame.Visible then -- Short-hand for 'if frame.Visible == true'
    frame.Visible = false
  else
    frame.Visible = true
  end
end)

If you would like for the GUI to tween, you can learn more here. If you have any questions on them, feel free to reply.

http://wiki.roblox.com/index.php?title=TweenPosition

1 comment

0

Thanks @badcc so my frame would be local frame = script.Parent and the button is local button = script.parent.parent?

This discussion is preserved as it was. New answers, comments, and votes are closed.