Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 20 Feb 2014 05:12 PM |
| How do I recall a loop? Can somebody explain to me how or post a link to a wiki page or something... I can't find it anywhere and I have a 77 line loop that needs to be recalled if a certain condition exists. Can somebody help? |
|
|
| Report Abuse |
|
|
Delones
|
  |
| Joined: 19 Jul 2010 |
| Total Posts: 1703 |
|
|
| 20 Feb 2014 05:14 PM |
turn it into a coroutine?
Time is a tool you can put on a wall, or wear it on your rizd. |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2014 05:14 PM |
while wait(0.5) do if ... then
?? |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2014 05:21 PM |
Put it in a function?
function loop() (loop here) end
if (condition) then loop() end |
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 20 Feb 2014 05:22 PM |
| I mean like, if a certain condition exists within the loop, restart the loop from the beginning. I heard you can do that by recalling the loop but I don't know how and I can't seem to figure it out. |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2014 05:23 PM |
Erm, recalling function?
function loop() for i, v in pairs(someTable) do if (condition) then loop() end end end
|
|
|
| Report Abuse |
|
|
Vyxium
|
  |
| Joined: 31 Aug 2010 |
| Total Posts: 1020 |
|
|
| 20 Feb 2014 05:31 PM |
| this is way to advanced for ScriptHelpers forum -_- |
|
|
| Report Abuse |
|
|
Azureous
|
  |
| Joined: 29 Jan 2012 |
| Total Posts: 25287 |
|
|
| 20 Feb 2014 05:33 PM |
| coroutine.resume(function) |
|
|
| Report Abuse |
|
|