#Coroutines

1 messages · Page 1 of 1 (latest)

manic coral
#
-- codecodecode
coroutine.wrap(function()
  while  bla < bla2 do
         task.wait(.1)
  end
end)()
-- codecodecode

Not sure if I understood Coroutines correctly
it yields at the beginning of task.wait(0.1) and resumes when task.wait(0.1) is over? How does the caller affect the coroutine. Does it's code get paused at when task.wait(0.1) finished and continues when task.wait(0.1) starts again?

unique mesa
#

is identical to task.spawn

#

not hard to check lua print("startwrap") coroutine.wrap(function() while true do print("step") task.wait(1) end end)() print("endwrap")

manic coral
#

the underlined part is what concerns me

iron sentinel
#

You're overcomplicating this

#

Roblox's task scheduler takes care of all of this