GUI Frame Visible Script not working?

I created this GUI, which allows you to select a company for my railway game. However, when I click “Choose another TOC” which is basically a back button, the SelectTOC frame won’t show, even though it says visible. I have attached a video on it.

1 Like

If any scripts are needed, I showed one in the video, just ask. It’s just confusing and I don’t understand how it’s happening

1 Like

Have you tried looking through your output to see the errors?

1 Like

There’s none

1 Like

In the script you show in the video, you set the parent frame to be not visible. This will make the GUI (TOC) invisible even if you make it visible.

2 Likes

On line 3 you’ve put:

script.Parent.Parent.Parent.Parent.Visible = false

You made the whole Frame invisible- you’ve put TOCSelector2 as a child of the code block I put above which makes that frame to become invisible including its children.
image

ps I suggest making variables to make your UI elements easier to access

3 Likes

I really want to hit my head against a wall. Thank you for pointing this out, you are a god my man. Specsavers here I come.

3 Likes

You duplicate so much of this code :confused:

Review your design and make sure you are accessing things safely. You may find it more suitable to use one scrtipt for your gui (modules will also help).

1 Like

I normally shorten it and use variables but for GUIs I don’t bother as I don’t have that much experience on them as I normally do more complex stuff. Turns out complex is more easier than the easy stuff lol

1 Like

Creating a solid foundation is key in any system. I would recommend that you put in the extra work on the foundations allowing you to build from and extend the GUI when needed.

1 Like