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

Click, Gui Pops up, click again, Gui goes away. How do I do this?

Asked by 10 years ago

This is what I have so far:

script.Parent.MouseButton1Click:connect(function() game.Players.LocalPlayer.PlayerGui.Button.Frame.Visible = true end)

But I don't know how to make it where you click it again it goes away..

0
Thanks dyler3! :D DDDropTheBase 0 — 10y

1 answer

Log in to vote
1
Answered by
dyler3 1510 Moderation Voter
10 years ago
script.Parent.MouseButton1Click:connect(function() 
if game.Players.LocalPlayer.PlayerGui.Button.Frame.Visible==true then
game.Players.LocalPlayer.PlayerGui.Button.Frame.Visible=false
elseif game.Players.LocalPlayer.PlayerGui.Button.Frame.Visible==false then
game.Players.LocalPlayer.PlayerGui.Button.Frame.Visible=true
end

Same idea really, just added 'if' statements.

Ad

Answer this question