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

How to remove GUI after clicked?

Asked by 10 years ago

I created a GUI,but i want it to be removed after I click it,i put this under the frame gui.MouseButton1Click:connect(function() print("Button1 click.") end)

Do you know what I can add in order to make it disappear but re-appear after resetting?

2 answers

Log in to vote
0
Answered by 10 years ago

Assuming reseting means character dying, add this. Make sure it's in StarterGUI, though.

gui:Destroy() --make gui the path you need.
0
What if it is a one time gui but then again you said assuming. HexC3D 830 — 10y
0
If it's an intro style GUI, put it directly into the player when "PlayerAdded", and destroy on click. You can either clone an existing one from somewhere, or add through instance.new. GoldenPhysics 474 — 10y
0
By the way, could you accept my answer? GoldenPhysics 474 — 10y
0
I can,but how do i make the script with PlayerAdded?I didint learn that yet,still learning how to script. xXxsmiley12xXx 0 — 10y
View all comments (2 more)
0
game.Players:PlayerAdded(Player GoldenPhysics 474 — 10y
0
then your code and "end)" GoldenPhysics 474 — 10y
Ad
Log in to vote
0
Answered by
HexC3D 830 Moderation Voter
10 years ago

Make sure there is a Text Button in the Frame and put the script in the TextButton

gui = script.Parent.Parent.Parent
script.Parent.MouseButton1Click:connect(function() 
print("Button1 click.") 
gui:Destroy()

end)

Destroy Removes it

Answer this question