Text Button disappears when clicked instead of making the frame invisible when clicked

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear! I want the button to make the frame go invisible when clicked and not the button it’s self

  2. What is the issue? Include screenshots / videos if possible! The button goes invisible when clicked

  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub? Nothing

After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!

local Frame = game.Players.LocalPlayer.PlayerGui.SurfaceGui.FAQ
local Buttton = script.Parent
Buttton.MouseButton1Click:Connect(function()
	Frame.Visible = false
end)

i got a lot of stuff in my explorer so i may have made an error when getting it Faq is the frame that i want invisible when button clicked and the Exit button 1 is where the local script is
image

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.

2 Likes

Setting a Frame’s visibility to false will also affect all of its descendants, therefore, you’d need to keep the button out of the FAQ frame to achieve this.

1 Like

Just make your Exit Button in the StarteGui and change the script into this:

local Frame = script.Parent.Parent.FAQ
local Buttton = script.Parent
Buttton.MouseButton1Click:Connect(function()
Frame.Visible = false
end)