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?
local Slide = script.Parent.Parent.Parent.Number
local Container = script.Parent.Parent
while true do
if Slide.Value > 1 then
Container.Visible = false
end
end
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.
local Slide = script.Parent.Parent.Parent.Number
function onClick()
if Slide.Value < 2 then
Slide.Value = Slide.Value + 1
end
end
script.Parent.MouseButton1Click: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.

2 comments
I cannot help you without knowing your hierarchy of the GUI. Like if its named ScreenGui,Frame,TextButton or whatever. Please tell me and I'll help.
While true do without a wait will crash