Why wont the GUI disappear?
So I have a script made that when the value of the NumberValue is greater than 1, it is supposed to make the visible trait of the frame false. Anyone know how to fix this?
1 | local Slide = script.Parent.Parent.Parent.Number |
2 | local Container = script.Parent.Parent |
4 | if Slide.Value > 1 then |
5 | Container.Visible = false |
So there is a TextButton that, when clicked, changes the number value to 2 of the NumberValue. Here is the script I used to do that in case that helps. After this script triggers it will trigger my other script (The one that is posted above) that I put inside a TextBox which displays the title of my game.
1 | local Slide = script.Parent.Parent.Parent.Number |
3 | if Slide.Value < 2 then |
4 | Slide.Value = Slide.Value + 1 |
7 | script.Parent.MouseButton 1 Click:connect(onClick) |
The hierarchy of this stuff is the following:
StarterGui, ScreenGui, Frame (Renamed Holder), then a NumberValue (Renamed Number) and a Frame (Renamed Container), then inside of Container is a TextButton (Renamed Next) and a TextBox. There is a script inside the TextButton and the TextBox. The script in the TextButton is the second script posted above. The one that is not working is inside the TextBox.