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

Another problem with my loading intro gui?

Asked by
Relatch 550 Moderation Voter
10 years ago

Now, when it reaches the size (1, 0, 0, 100), it does nothing. I checked if it does reach that size, but that may be the problem. Any help?

wait(1)
script.Parent.Loading.Text = "Loading"
script.Parent.Loading:TweenSize(UDim2.new(1,0,0,100), "Out","Back", 10)
wait(10)
if script.Parent.Loading.Size == UDim2.new(1, 0, 0, 100) then
    script.Parent.Loading.Transparency = 1
    wait(0.1)
    for i = 0,1,.05 do
        script.Parent.BackgroundTransparency = i
        wait()
    end
end

1 answer

Log in to vote
1
Answered by 10 years ago

Let's start with the root of the problem. First off, after tweening you use wait(1). The only issue there, is that, like I said before, Tween does not yield. This means that you need to match it with the time it takes to tween.

The arguments of TweenSize are as follows:

UDim2 endSize, EasingDirection easingDirection = Out, EasingStyle easingStyle = Quad, float time = 1, bool override = false, Function callback = nil As you can see by this code, 10 is the time.

script.Parent.Loading:TweenSize(UDim2.new(1,0,0,100), "Out","Back", 10);

This means the wait(1) should be wait(10).

Hope this helped, ask me if you have any further issues or post on scripting helpers.

1
Still does the same thing. Do you mean the wait before it checks if it has reached (1, 0, 0, 100)? Relatch 550 — 10y
1
Mhm. KOTwarrior 150 — 10y
1
Well, it still does the same thing. Relatch 550 — 10y
Ad

Answer this question