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

Optimised script ?

Asked by
Vitou 65 Snack Break
10 years ago

Hello, I'm making a GUI who's making a loading bar. Part > SurfaceGUI > Percentage ( TextLabel) ; Background (TextBox)

SurfaceGui = script.Parent
Percentage = SurfaceGui.Percentage

a = 0

while true do
    a = a + 12
    Percentage.Size = UDim2.new(0, a, 0.1, 0)
    wait (0.1)
if 
    a == 1200
    then
    break
end
end

Is there a way to optimise this script or is it good ? Thanks

1
Tween size can be good too. xImmortalChaos 565 — 10y
0
Yes, TweenSize would give you a smoother animation. Perci1 4988 — 10y

1 answer

Log in to vote
1
Answered by
Ekkoh 635 Moderation Voter
10 years ago

I would use scale rather than offset, that way you can resize your GUI without worrying about going in this script and changing the offset so that the loading bar fills up the entire frame. Just a side note, fake loading bars are the worst so I really hope you're actually loading something.

Ad

Answer this question