I made a loading GUI. I want to make it invisible after it has loaded. this is the basic script that loads the GUI:
for i = 0,100,1 do
script.Parent.PercentLabel.Text = "Progress: " .. math.floor(i) .. "%"
script.Parent.Scroll.Size = UDim2.new(0, i*4, 0, 40)
wait(math.random(0.08,0.80))
end
I have tried a few ways how to make it invisble after loading:
- Gui Size method:
for i = 0,100,1 do
script.Parent.PercentLabel.Text = "Progress: " .. math.floor(i) .. "%"
script.Parent.Scroll.Size = UDim2.new(0, i*4, 0, 40)
wait(math.random(0.08,0.80))
if script.Parent.Loading.Size = {0,400},{0,40}then
script.Parent.Visible = false
end
end
- Text Method:
for i = 0,100,1 do
script.Parent.PercentLabel.Text = "Progress: " .. math.floor(i) .. "%"
script.Parent.Scroll.Size = UDim2.new(0, i*4, 0, 40)
wait(math.random(0.08,0.80))
if script.Parent.PercentLabel.Text = "Progress: 100%"then
script.Parent.Visible=false
end
end
- Wait Method:
for i = 0,100,1 do
script.Parent.PercentLabel.Text = "Progress: " .. math.floor(i) .. "%"
script.Parent.Scroll.Size = UDim2.new(0, i*4, 0, 40)
wait(math.random(0.08,0.80))
wait(55)
script.Parent.Visible = false
end
None of these methods work, in fact the wait method broke the script! Can some one help me with this?
