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

'repeat' loop doesn't end when requirements met?

Asked by 3 years ago

I haven't coded in a really long time so i'm quite rusty with coding atm, can someone help me out with this very simple loop problem

local part = script.Parent
local orig = "17, 18, 2"



repeat
    wait(0.001)
    part.Size = part.Size + Vector3.new(0,0.5,0)
until part.Size == orig

Once the part size is equal to 'orig' it doesn't stop the loop. I might be missing a very big point; any help would be appreciated.

1 answer

Log in to vote
0
Answered by
WoTrox 345 Moderation Voter
3 years ago

The problem is that orig is a string. Try this:

local orig  = Vector3.new(17, 18, 2)

This will make orig a Vector3 value instead of a string

0
Agreed TheEagle722 170 — 3y
0
Thanks! x_Marwan 6 — 3y
Ad

Answer this question