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

How to make gui closing button?

I used this script to have it close:

1 print ("Close button loaded") 2 3 button = script.Parent 4 window = script.Parent.Parent.Parent 5 6 function onClicked(GUI) 7 window:Destroy() 8 end 9 script.Parent.Mousebutton1Click:connect(onClicked)

I HAVE NO IDEA HOW TO DO IT! (and yes i'm using a textbutton not a textbox

please tell me how to make a gui closing gui or what im doing wrong.

1 comment

0

uh i didnt see how that would post so the 1 2 3 4 5 6 7 8 9 are different lines

1 answer

script.Parent.MouseButton1Down:connect(function() --make sure the script is inside the textbutton
script.Parent.Parent:Destroy() -- do script.Parent.Parent.Parent until you get to the ScreenGui object
end)

Hope I helped!

3 comments

0

i will try! thanks for helping!

0

it didn't work, WAIT do i put the button on the outter part of the gui?

0

Read the comments in the script.

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