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

How would you make the GUI get bigger by the seconds you enter?

Asked by 8 years ago

S0 I am trying to make this XP bar have a full bar that grows with it. It is very confusing... Help?

while true do
    wait(0.01)
    script.Parent.Size = (0.1)
    wait(2)
    script.Parent.Text = (0.2)
    wait(5)
    script.Parent.Text = (0.3)
    wait(10)
    script.Parent.Text = (0.4)
    wait(15)
    script.Parent.Text = (0.5)
    wait(20)
    script.Parent.Text = (0.6)
    wait(25)
    script.Parent.Text = (0.7)
    wait(30)
    script.Parent.Text = (0.8)
    wait(35)
    script.Parent.Text = (0.9)
    wait(40)
    wait(0.1) script:Remove()
end
0
There are a couple of things that are probably wrong here, what are you trying to accomplish? BlackJPI 2658 — 8y
0
I am trying to make the Full XP bar, that is at 0 fill in the empty XP bar. I want to make the X axis move more until it fills it. Theevilem 23 — 8y
0
Okay, when do you want it to change in size? After a particular amount of size, it automatically resizes? Once a certain event happens? BlackJPI 2658 — 8y
0
Basically I want it to change size when you collect an item. Theevilem 23 — 8y

1 answer

Log in to vote
0
Answered by 8 years ago

I would recommend using a simple for-do statement. You also changed Size to Text

Here is my improved script:

waitTime = 5

for i = 0, 1, .1 do
    script.Parent.Size = UDim2.new(i,0,1,0)
    wait(waitTime)
    waitTime = waitTime + 5 --Waits five more seconds each time the script loops around
end
Ad

Answer this question