Suppose that I have a co-routine function and I want it to be ran two and run at the same time so that they execute the same code but there's something uniquely different in that code. Is this possible?
For instance, I have a script that has a function that rotates a gui. I want to use that function to rotate a gui, another gui, another gui, and then one last gui and run that function (4 times) at the same time. It's co-routine. I tried it but for some reason it's not letting me run the same function(2 times at the same time).
Does anybody know?
The same coroutine can't be run twice at the same time. That's not what coroutines are.
Instead, make a new coroutine (but it can still wrap up the same function).
If you just need new threads and aren't using coroutines as coroutines, consider using spawn(func)
instead of coroutine.resume( coroutine.create( func ) )
or coroutine.wrap(func)()
.