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
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.
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)
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?