If you could, that'd be great! (I want to know to further my knowledge and in the end help more people here. If anyone knows how to explain it, please do!)
✓ ANSWER ACCEPTED
Could someone explain coroutines to me, and maybe give an example?
1 answer
✓ Accepted answer
A coroutine is essentially a new thread within a script. This allows you to have multiple loops at the same time and to continue a script while also yielding, amongst other things. For example:
local loop = coroutine.create(function()
while true do
wait()
print("Hello")
end
end)
coroutine.resume(loop)
while wait() do
print("World!")
end
--Both loops here would run simultaneously
This discussion is preserved as it was. New answers, comments, and votes are closed.

1 comment
Thanks for this, and ESPECIALLY for the link. You well deserve the Community Mod rank.