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

How do you make it so that when you press an ImageButton the screengui gets removed?

AlvinBlox made a video on this but it got removed, so can anyone tell me how to make the screengui disappear when you press the button? Thanks in advance.

1 comment

0

this is not a script request site dude, do some research before u ask for help

2 answers

✓ Accepted answer

sure; put the code in a localscript, and put the locascript in the button

local button =script.Parent -- put here the directory of the button
local screenGUI = --put here the directory for the screen GUI

button.MouseButton1Down:Connect(function()
	screenGUI.Enabled = false
end

change the value of screenGUI varaible to where the screen GUI object is located

2 comments

0

Thank you!

0

accept my answer

Make A ScreenGui, Add A Frame, Add A Button, And The Use This Method. This has to be in a localscript. nder the gui

Button1.MouseButton1Click:connect(function()
  ScreenGui:Destroy()
end)

Replace Button1 with your button and then you replace ScreenGui with your ScreenGui's Name.

1 comment

0

Thank you!

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