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

How do I fix this script to stop when the X Size is equal to 1,0?

wait(2)
while wait(0.05) do
	if script.Parent.Size == 1 then
	else
		script.Parent.Size = script.Parent.Size + UDim2.new(0.01, 0, 0, 0)
	end
end

1 answer

You just forgot to put UDim2.new() at the line 3 and if you want a load gui don't put a while wait(0.05) do because while wait() do or while true do is for loops if you want it to stop growing when its to a Size you want you need to put while not do or for i = 1, 10 do.

your code :

wait(2)
while wait(0.05) do
    if script.Parent.Size == 1 then
    else
        script.Parent.Size = script.Parent.Size + UDim2.new(0.01, 0, 0, 0)
    end
end

Code fix :

wait(2)
while not script.Parent.Size == UDim2.new(.1, 0, 0, 0) do
	script.Parent.Size = script.Parent.Size + UDim2.new(.01, 0, 0, 0)
	wait(.05)
end

Sorry for my bad grammar

5 comments

0

The GUI keeps growing. No output error

0

So how do I fix it?

0

It only grew once because there was no loop...

0

More than once xD It's a loading GUI

0

If the script is working can you Accept the awnser please? ;)

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