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

How To Make A Text Button Close A Certain GUI? [closed]

Asked by 5 years ago

HI, I'm Tantalingo and I'm currently making a game. In this game, I have a welcome screen with a text button. I want to make it so when the text button is clicked, the GUI isn't shown anymore.

Thank you, .Tantalingo.

I don't have any script currently
0
I'm would also like to know how to do this too. GodsGraceSavesAll 6 — 5y
0
Thanks! Ill give that a try! GodsGraceSavesAll 6 — 5y
0
This is not a request site. What have you tried to do? A quick google search could have gone a long way! Thetacah 712 — 5y
0
Thank you for helping everyone! GodsGraceSavesAll 6 — 5y

Closed as Not Constructive by xPolarium, WideSteal321, and Goulstem

This question has been closed because it is not constructive to others or the asker. Most commonly, questions that are requests with no attempt from the asker to solve their problem will fall into this category.

Why was this question closed?

2 answers

Log in to vote
1
Answered by
bossay6 62
5 years ago
Edited 5 years ago

First, you want to detect if the button has been clicked. You can do this with a function. (Make sure this script is a local script inside the button.)

script.Parent.MouseButton1Click:connect(function()

end)

Next, you want to set the Visible property of the Gui you want to disappear to false.

script.Parent.MouseButton1Click:connect(function()
    local GUI =         --Gui to target here
    GUI.Visible = false
end)

Make sure the variable "GUI" is the Gui you want to disappear when the button is clicked.

Ad
Log in to vote
0
Answered by 5 years ago

K so try this

local button = script.Parent --  Button that u click to close
local Frame = script.Parent.Parent.Frame -- Frame that you want to close

button.MouseButton1Click:Connect(function()
    if Frame.Visible == true then -- If the frame  is visible then...
        Frame.Visible = false -- Make the Frame invisible
    elseif Frame.Visible == false then -- If the Frame is Invisible then..
        Frame.Visible = true -- Make the Frame Visible
end
end)