Am I right by stating I can only have one single instance of a coroutine running at a time? This question may be difficult to interpret, so I have included an example below.
co = coroutine.create(function()
print("hi scripting helpers")
wait(10)
end)
for i = 1, 10 do
coroutine.resume(co)
end
This would only print "hi scripting helpers" once and then error once 10 seconds has elapsed.
How do I go about solving this?
NOTE: This isn't the actual purpose of why I'm asking, I just included this example to make the question easier to understand.
Thanks for your help.
EDIT:
Sorry bit of a noob here, not used to being able to edit my initial question.
I found a more relevant solution to my problem so someone said it would be best if I add it here.
function newcor(arguments)
coroutine.resume(coroutine.create(function()
print(arguments)
wait(10)
end))
end
for i = 1, 10 do
newcor("hi scripting helpers")
end
The above example lets me enter in arguments and will run an infinite number of times, even when the original coroutine is still running.

1 comment
This is probably too advanced for OP, but; the environement in the script Spawn()ing a thread is shared with that Spawn()ed thread, the enviornment of a script creating a coroutine is not shared with that coroutine.