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

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

Asked by 8 years ago
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

Log in to vote
0
Answered by 8 years ago

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

0
The GUI keeps growing. No output error SchonATL 15 — 8y
0
So how do I fix it? SchonATL 15 — 8y
0
It only grew once because there was no loop... SchonATL 15 — 8y
0
More than once xD It's a loading GUI SchonATL 15 — 8y
0
If the script is working can you Accept the awnser please? ;) ScripterGame 145 — 8y
Ad

Answer this question