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

How to remove GUI after clicked?

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

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

gui:Destroy() --make gui the path you need.

6 comments

0

What if it is a one time gui but then again you said assuming.

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.

0

By the way, could you accept my answer?

0

I can,but how do i make the script with PlayerAdded?I didint learn that yet,still learning how to script.

0

game.Players:PlayerAdded(Player

0

then your code and "end)"

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

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