Lets say I want to have a process run in the background once, and I don't need to reference it later.
Is it possible to create a coroutine without a key variable?
like how you can call a function like
function() --do somehting end
Is there a way to do this with coroutines? I'd imagine it would be along the lines of
coroutine.resume(coroutine.create(function() --do something end))
You can do things such as using spawn() or delay(), but there is no actual coroutine.resume(coroutine.create()) direct shorthand.
Actually there is a way to shorthand it: coroutine.wrap The way to use it would be
local example = coroutine.wrap(function() print ("a") end)
Basically it takes a coroutine and assigns it a function. To use it you would just call the function you assigned to it with whatever parameters requires. Hope this helps. :)