cqRoy
(Royy)
June 15, 2020, 5:53am
#1
Hello, so I’ve made a repeat until loop but for some reason it doesn’t work at all
Here is the loop:
repeat
script.Parent.Size = script.Parent.Size + Vector3.new(8,0,0)
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(4,0,0)
until script.Parent.Size == Vector3.new(2048, 63.76, 58.28)
I also tried to use a while true do with a Break() function, but still didn’t seem to work.
Here is the size of the part before resizing : (351, 63.76, 58.28)
Seoarro
(seo)
June 15, 2020, 5:57am
#2
Maybe you should change the repeat line to repeat wait()
.
cwd30
(seawead30)
June 15, 2020, 5:58am
#3
Your script timed out since you were repeating too fast. You need to add a wait().
Yeah, also, what didn’t work? Does it not stop when it reaches its requirement or did it happened too fast?
cqRoy
(Royy)
June 15, 2020, 6:25am
#5
Eveb when I add wait() still same result, won’t move an inch
cqRoy
(Royy)
June 15, 2020, 6:25am
#6
It doesn’t do what I told it to repeat at all.
cqRoy
(Royy)
June 15, 2020, 6:26am
#7
I don’t understand what you mean? so it doesn’t occur at all? or does it not stop when it reaches its requirement or did it happened too fast?
cqRoy
(Royy)
June 15, 2020, 6:31am
#9
It doesn’t occur at all , stays exactly the same.
first of all, you need a wield like wait()
and other stuff.
take it in mind even if it doesn’t work, it is important for your future stuff.
second of all, there may is a chance that the script didn’t ran, or that specific line of code didn’t ran.
cqRoy
(Royy)
June 15, 2020, 6:35am
#11
Alright, I’ve found the solution (god I’m such an idiot), anyways, I had a while true do loop before it… thanks to you I’ve found it.
Usering
(Usering)
June 15, 2020, 6:35am
#12
You should increment a variable and then set + compare it.
local x = 351
repeat
x = x + 8
script.Parent.Size = Vector3.new(x, script.Parent.Size.Y, script.Parent.Size.Z)
script.Parent.CFrame = script.Parent.CFrame * CFrame.new(4,0,0)
until x >= 2048