Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Optimised script ?

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

2 comments

1

Tween size can be good too.

0

Yes, TweenSize would give you a smoother animation.

1 answer

✓ Accepted answer

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.

This discussion is preserved as it was. New answers, comments, and votes are closed.