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

LOADING GUI Script not working? [ANSWERED]

I wanted to make a Loading Screen and this is the script I used:

T = script.Parent.Bar

for i = 1, 50  do 
T.Size = T.Size + UDim2.new(0.001,0,0)
p.Text = "LOADING ASSETS "..(i*2).."%"
wait(0.1)
end
if T.Text == "LOADING ASSETS 100% "
then p.Text = "COMPLETE"
wait(3)
end
T.Parent:Remove()

The thing is because it Multiplys 50 by 2 then it'll only go to 100, But I have the bar at 300 in the X axis, So it'll go only some of the way, So If I put

for i = 1, 150 do
T.Size = T.Size + UDim2.new(0.001,0,0)
p.Text = "LOADING ASSETS "..(i*2).."%"

It SHOULD go all the way, but instead it just goes super far...

Can anyone either help me or give me a script that is functional??

[QUESTION UNANSWERED]

3 comments

0

You could try using division instead of addition. Can't come up with an exact equation off my head rn, but you could try something like 300/50, for the X axis.

0

Oh alright

0

Just as I expected, It didn't work. Have any other ideas?? Should I use a different script??

2 answers

✓ Accepted answer

T.Size = T.Size + UDim2.new(0.001,0,0)

UDim2 has four parameters. X scale, X offset, Y scale, and Y offset. You left one of them out, and I'm not sure which, but it should look something like this:

T.Size = T.Size + UDim2.new(0.001,0,0,0)

3 comments

0

I forgot to put the extra one in the post, I did actually put the fourth one and it also didn't work.

0

But I will try just to make sure :D

0

Was this your solution?

I have answered the question myself, I had false numbers but I have fixed it. I will accept RedCombee for being the only one to answer.

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