What is coroutine used for and how do i make one?
Here, read this thread from the Roblox WIKI, and it'll explain, also sorry that I didn't type out an explanation, but I don't know how to explain what they do. :P;
Hope this helped!
It's as if the script were saying, "Go on, I got this."
When you create a coroutine, it creates another thread, inside this thread you will have your code, whatever it may be. However, while this code is running inside the coroutine, the script continues on and runs the rest of the script. For example:
coroutine.wrap(function() while wait(1) do print("Hi, I'm doing my own thing!") end end)() print("Bye, I'm off to more important things!")
And that would print, "Hi, I'm doing my own thing!" once every second, but also print, "Bye, I'm off to more important things!" at the same time.
Hope that helped.