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

ScreenGui that will disapear when clicking a button/part?

I'm making a thing if you click a button a ScreenGui will pop up and flicker witch i already did but. I want it so when u click another button the ScreenGui will disappear. I have this so far

function onClick() script.Parent.Visible = false script.Parent.Parent.Parent.Frame2.Visible = false wait() end script.Parent.ClickDetector.MouseClick:connect(onClick)

2 answers

✓ Accepted answer

well, I don't really get what you are talking about (Use the Lua Block code feature) but here is what I am assuming you want

debounce = true

function Clicked()
	if debounce == true then
		debounce = false
		workspace['PartNameHere']['ScreenGui'].Visible = false
		wait()
		debounce = true
	end
end

script.Parent.MouseClick:Connect(Clicked) -- Pulls a function
	

What this does it when the part detects the mouse click then the screen GUI becomes invisible

For a simple closing, this is what I would do:

script.Parent.MouseButton1Down:Connect(function() script.Parent.Parent.Visible = false end)

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