Garry's Mod Wiki

Garry's Mod Wiki

  vararg coroutine.yield( ... )

Description

Pauses the active coroutine and passes all additional variables to the call of coroutine.resume that resumed the coroutine last time, and returns all additional variables that were passed to the previous call of resume.

Arguments

1 vararg returnValue
Arguments to be returned by the last call of coroutine.resume.

Returns

1 vararg
Arguments that were set previously by coroutine.resume.

Example

Demonstrates the use of using varargs as a return value.

local co = coroutine.create( function() coroutine.yield( "Hello world!" ) end ) print( coroutine.resume( co ) )
Output:
true, "Hello world!"

This site is a community mirror of the official Garry's Mod wiki.. This site is not maintained by Facepunch Studios.

Page content is automatically updated four times a day. Edits and history are not available.

Last Parsed: Loading...