Close button closes all GUI's

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

  1. I want to close one GUI, and the button is all fine and all, but my close button closes all GUI’s. How can I make it so that the text button only closes one GUI?

  2. The button closes one GUI, not all of them.

  3. I tried changing the script at bit, but it still didn’t work.

Can you provide the script?

script.Parent.MouseButton1Click:Connect(function()

 script.Parent.Parent.Visible = false

end)

show us the layout of the explorer bar

For the text button, you mean?

Show us the content inside of StarterGui

I’m going to assume here that script.Parent.Parent is the frame containing all the other frames that you want to be visible at other times.

How come? Why do I have to do that?

Yeah. If that is the case, then just do script.Parent.Visible = false

So we know you are directing the script correctly

Hello, BenzGamingz.
I can see, you are already getting help, but let me just give you my theory, to why it doesn’t work for you. Since you didn’t provide us, with much information, I can only guess as to what is wrong.

Now with that said, I think your problem may be, that you’re actually making the wrong “gui” invisible. Whenever you set .Visible = false, on fx a frame, you also set everything inside that frame, to be invisible. Therefore, if you don’t want whatever is inside the frame, to also go invisible, you’ll need to either:

A: Change ur script, so u only put .Visible = false for the stuff, inside the frame, that you want invisible.
B: You take out the stuff, that is currently inside the frame, that you’re setting to .Visible = false, and that way, those frames, textlabels etc. won’t also go invisible, because their visibility is no longer dependent on their Parents visibility.

Hope this helps, else just reply to this answer, and I will gladly help you some more :slight_smile:

Have a great day!

That just removes the button when clicked.

Oh. Then I didn’t assume right. Like @Crrustyy said, it would be helpful if you showed a screenshot of your explorer

Screen Shot 2020-05-06 at 2.43.57 PM

I’m using this model to test w/ TextButtons.

An explanation to your problem and how to fix it, has been given in the reply i just posted. Make sure to read it carefully :slight_smile:

script.Parent.MouseButton1Click:Connect(function()

 game.Players.LocalPlayer.PlayerGui.UiName.Enabled = false

end)

works with local script only (i didnt tried to do that with normal script but you can try)

make this

local you = script.Parent.Parent.Frame
script.Parent.Touched:connect(function()
you.Visible = false
end

1 Like

Normal script doesn’t work nor does the local script.

The game.Players.LocalPlayer will error out in any server-sided script.
That can only be accessed by players.