lua - Err using coroutine -
i'm not sure if misunderstood use of coroutine, here code:
talk = coroutine.create(function () print("i speaking within 60 seconds") end) time = coroutine.create(function () if coroutine.status(talk) == running = 60, 0, -1 print(i) end sleep(1) else coroutine.resume(talk) end end) coroutine.resume(time)
all print speaking within 60 seconds, expecting within countdown. how fix this?
talk = coroutine.create(function () print("i speaking within 60 seconds") coroutine.resume(time) end) time = coroutine.create(function () = 60, 0, -1 print(i) coroutine.resume(talk) end end) coroutine.resume(time)
Comments
Post a Comment