Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Gui buttons

Asked by 11 years ago

I need help with guis button scripts When click the button

1function mousebutton1down (click)

to open the gui and then i need a close button

1button:remove()

Thanks if you can help

0
What exactly do you need ? Be more precise please. Hippalectryon 3 — 11y
0
Please do not spam tags. Thanks! User#2 0 — 11y
0
i didnt spam tags... i only put one User#210 0 — 11y

1 answer

Log in to vote
2
Answered by
badcc 30
11 years ago
1local frame = ... -- Be sure to replace these two with proper variables.
2local button = ...
3button.MouseButton1Down:connect(function()
4  if frame.Visible then -- Short-hand for 'if frame.Visible == true'
5    frame.Visible = false
6  else
7    frame.Visible = true
8  end
9end)

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

0
Thanks @badcc so my frame would be local frame = script.Parent and the button is local button = script.parent.parent? User#210 0 — 11y
Ad

Answer this question