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?
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?
Assuming reseting means character dying, add this. Make sure it's in StarterGUI, though.
gui:Destroy() --make gui the path you need.
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.
6 comments
What if it is a one time gui but then again you said assuming.
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.
By the way, could you accept my answer?
I can,but how do i make the script with PlayerAdded?I didint learn that yet,still learning how to script.
game.Players:PlayerAdded(Player
then your code and "end)"