Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 27 Feb 2016 06:25 PM |
So i want to make it loop for 4 seconds, then stop, by using coroutines. Why does this not work:
local printer = coroutine.create(function(text) while wait(0.1) do print(text) end
end)
coroutine.resume(printer, "hi")
wait(4) coroutine.yield(printer)
|
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
| |
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
| |
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 27 Feb 2016 06:38 PM |
| NO HELP? It's a coroutine for god's sake. BUMP3 |
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
| |
|
|
| 27 Feb 2016 06:51 PM |
| I responded to your previous thread with the answer, you know. |
|
|
| Report Abuse |
|
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
| |
|
Zechariax
|
  |
| Joined: 22 Mar 2012 |
| Total Posts: 206 |
|
|
| 27 Feb 2016 06:55 PM |
| @KINGKILLER100 but you didn't solve my problem |
|
|
| Report Abuse |
|
|
|
| 27 Feb 2016 07:00 PM |
| That's because you're not paying attention. If you had looked at my code, you would see that coroutine.yield is supposed to be INSIDE the coroutine function, not at the point you want the function to stop. |
|
|
| Report Abuse |
|
|