local addCo = coroutine.wrap(function(a, b)
print(a + b)
end)
addCo(2, 4)
addCo(3, 6)
How can I make this coroutine not die. (coroutine.yield doesn’t work.) I like the implementation of this, which is why I want a coroutine function to be able to be ran multiple times.
You can’t stop it from dying. What you can do is create a function that wraps and runs a new coroutine, then call that function multiple times and passing all the arguments you need.