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

How do you make it when you press the GUI and it erases until you respawn back?

Asked by 10 years ago

I need this script if anyone can help me it would be a huge help!

2 answers

Log in to vote
1
Answered by
Shawnyg 4330 Trusted Badge of Merit Snack Break Moderation Voter Community Moderator
10 years ago

This goes inside the button of the GUI.

gui = script.Parent

gui.MouseButton1Click:connect(function()
    gui:Destroy()
end)
Ad
Log in to vote
0
Answered by 10 years ago

If you make the whole GUI visible at start, then I think this script should work, I wouldn't use :Destroy() since you might not be able to get it back:

-- Put this in the button and make sure the Button's Parent is a frame. Make sure that the Frame's Parent is a ScreenGui. You can rename the button, Frame and ScreenGui to whatever you want.

script.Parent.MouseButton1Click:connect(function()
    script.Parent.Parent.Visible = false
end)

Please tell me if this doesn't work, as I am in the middle of Beginners and Advanced scripting.

Answer this question