coroutine.create

From GMod Wiki

Jump to: navigation, search
Function
Syntax coroutine.create( Function func )
Where is this used?
Description:
Creates a coroutine to execute a function in it's own 'thread'.
Returns: Corout Table
Part of Library: Corout
Realm: NewerShared.png
BBCode Link: [b][url=http://wiki.garrysmod.com/?title=Coroutine.create]Coroutine.create [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b]


Examples

DescriptionCreates a coroutine printing "Hi".
Used onNewerShared.png
Code
 
co = coroutine.create(function ()
       print("hi")
     end)
 
print(co)
 
Outputthread: 0x8071d98


See Also

Personal tools
Namespaces
Variants
Actions
Navigation
Lua Scripting
Functions
Hooks
Toolbox