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

ScreenGui that will disapear when clicking a button/part?

Asked by 4 years ago

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

Log in to vote
0
Answered by 4 years ago

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

Ad
Log in to vote
0
Answered by 4 years ago

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

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

Answer this question