|
| 13 Jun 2014 10:05 PM |
Anything that does what 'repeat' does?
For example, after the repeat finishes, the rest of the code continues. Anything like that? I find repeat, buggy, glitchy, and game-breaking.
repeat wait() until blah --Continue with code |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Jun 2014 10:06 PM |
repeat isn't glitchy, and it's easy to replicate it:
while wait() and not blah do end |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 10:07 PM |
for i=1,10,1 do print(i) end print'Done' |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 10:08 PM |
| Though I do appreciate your reply, do you mind taking a look at my script seeing if it is one-line replaceable? Using repeat for it just destroys what I'm doing. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 10:09 PM |
| Wait nevermind. It's late anyways. I'll just experiment for a few days. |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 10:14 PM |
Okay. now I am really done. Can some one please look over this?! I am done. I tried almost everything! It's clear nothing I do will fix it.
-Coroutines -Repeat -While wait() do
>:| |
|
|
| Report Abuse |
|
|
Convorus
|
  |
| Joined: 19 Jun 2013 |
| Total Posts: 624 |
|
|
| 13 Jun 2014 10:15 PM |
T = 1
for i = 1, T do [SCRIPT HERE] end
put your script in the blank spot. PM me if it worked :-) |
|
|
| Report Abuse |
|
|
Convorus
|
  |
| Joined: 19 Jun 2013 |
| Total Posts: 624 |
|
|
| 13 Jun 2014 10:16 PM |
woops.
T = 1
for i = 1, T do (Script actually here) end |
|
|
| Report Abuse |
|
|
|
| 13 Jun 2014 10:17 PM |
| Thank you convorus, but I don't think that's what I need. |
|
|
| Report Abuse |
|
|
Convorus
|
  |
| Joined: 19 Jun 2013 |
| Total Posts: 624 |
|
| |
|
| |
|
|
| 13 Jun 2014 11:36 PM |
X = 1 repeat X = X + 1 print("Hi") until X = 5
X = 1 while X ~= 5 do wait() X = X + 1 print("Hi") end |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 13 Jun 2014 11:36 PM |
War, no. They are different.
The second one would be
X = 1 X = X + 1 while X ~= 5 do X = X + 1 print("Hi") end |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 09:48 AM |
I tried 'while wait() do' --If statements.
And it still performs the same thing. It loops the 'Ended' value to true. Sick. |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 09:54 AM |
repeat wait() until blah
and
while not blah do wait() end
Should be the same |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 10:00 AM |
| Do you want to see my script? |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Jun 2014 04:44 PM |
War, they are not. If they were then repeat would not have been invented.
while = while-do repeat = do-while |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:14 PM |
That's my point
while not blah do--Will loop until blah (notice the "while NOT BLAH do" part)
repeat until blah--Will loop until blah
Those are the same. However
while blah do end
and
repeat until blah
Is not |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Jun 2014 06:16 PM |
Wow do you not read the replies? You literally restate what I said. And no. repeat x = x + 1 until blah is not the same as while not blah do x = x + 1 end
Learn what repeat and while loops are. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Jun 2014 06:17 PM |
| You literally reword* what I say |
|
|
| Report Abuse |
|
|
| |
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Jun 2014 06:18 PM |
Then stop saying stuff that is wrong
repeat does code then checks "DO code WHILE condition" while checks then does code "WHILE condition DO code" |
|
|
| Report Abuse |
|
|
|
| 14 Jun 2014 06:36 PM |
I understand that but I tested this;
LoopType = "WhateverHereTestedBoth" x = 0 blah = false
if LoopType:lower() == "loop" then while not blah do x = x + 1 print(x) if x == 10 then blah = true end wait() end
elseif LoopType:lower() == "repeat" then repeat x = x + 1 print(x) if x == 10 then blah = true end wait() until blah end
I understand how it isn't doing the same thing, but it still outputs the same. |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Jun 2014 06:43 PM |
Yeah, but do this: x = 10 See what happens when you use repeat |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 14 Jun 2014 06:44 PM |
No, your while just did the same as your repeat in that case.
Do this:
x = 10
repeat x = x + 1 print(x) until x >= 10 while x < 10 do x = x + 1 print(x) end
See why repeat is dangerous here? |
|
|
| Report Abuse |
|
|