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

How do I make a Frame size change? For now I use + UDim2.new(0,2,0,0)

How do I make the size change for every loop?

for n = 0, 100 do
	textbutton.Text = "Loading..."
	frame.Size = loader.Size + UDim2.new(0,2,0,0)
	wait(math.random(0.4,0.5))
end

3 comments

0

Are you trying to make a loading bar for your game?

0

Yh. But don't know how to actually make it follow and wait to all assets are loaded. Can't find any tutorials and I think it's too complicated.

0

Please upvote if it worked how you wanted it to :)

2 answers

✓ Accepted answer

Here is a script from my game that increases the loading bar by 0.009 every loop. It makes it look like a slow moving loading bar.

p = script.Parent
il = script.Parent.ImageLabel
for i = 1, 100 do 
il.Size = il.Size + UDim2.new(0.009,0,0)
p.Text = "Loading Tumble-Slides "..(i*1).." %"
wait(0.1)
end

Please upvote if it worked how you wanted it to :)

You can use TweenSize() and TweenPosition() to move a GUI fluidly:

frame:TweenSize(UDim2.new(0.5,0,0.5),Enum.EasingDirection.Out,
Enum.EasingStyle.Sine,0.5,true)

Learn more about TweenSize() and TweenPosition() here.

1 comment

0

I tried but it doesn't work like I wan't it too. It needed to be + 2 every time it has waited. Also because I use math.random in my script.

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