Try it in your browserpreview Source

Wrap CoroutineLuau✎

A coroutine as a plain function: calling it resumes the thread. Errors inside propagate to the caller rather than coming back as a false, which Resume does instead.

Pending review

Wrap CoroutineResumeFunction
  • the language itself, so it works in Roblox and in Lune
  • names its result — Result name in the Inspector is the local it binds, and a Declare Local reading that result makes a second one: see Variables and locals

Inputs

  • in:execution
  • Function:functionmust be wired

Outputs

  • then:execution
  • Resume:function

What it compiles to

luau
coroutine.wrap(fn)

Not reviewed yet