Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

Help with Loading GUI?

Asked by 10 years ago

Hi, I'm having a problem with my current Loading GUI. Every time I test it, the load bar increases its size, but doesn't change when it reaches its limit, as I intended to. I would thank any help with debugging my script

Percentage = script.Parent.Percentage
LoadBar = script.Parent

for i = 1, 200 do
    LoadBar.Size = LoadBar.Size + UDim2.new(0, 1, 0, 0)
    Percentage.Value = Percentage.Value + 1
    wait()
    if Percentage.Value == 200 then
        Finish()
    end
end

function Finish()
    Label = script.Parent.Parent.Loading
    Label.Text = "Succesfully Loaded!"
    wait(1)
    Frame = script.Parent.Parent
    for i = 1, 100 do
        LoadBar.BackgroundTransparency = LoadBar.BackgroundTransparency + 0.1
        Frame.BackgtoundTransparency = Frame.BackgroundTransparency + 0.1
        Label.TextTransparency = Label.TextTransparency + 0.1
        wait()
        if LoadBar.BackgroundTransparency == 1 and Frame.BackgroundTransparency == 1 and Label.TextTransparency == 1 then
            script.Parent.Parent:remove()
        end
    end
end

mranderson11

Answer this question