I want to create a table of coroutines In which I can choose which ones I want to keep running, stop, or resume at free will. Is that possible?
Yes, coroutines can be stored.
local Coroutines = {
Wrap = coroutine.wrap(function()
print("Wrap")
end),
Create = coroutine.create(function()
print("Create")
end)
}
Coroutines.Wrap() -- Wrap
coroutine.resume(Coroutines.Create) -- Create
You cannot store corrutine.resume because it throws an error.