I looked here spawn() function and it doesn't give a lot of information, can someone give an example on how to use it/how it works and what it does?
A basic way to put it, its an updated coroutine. I use them as basic code jumps where i can execute something at the same time.
Dont use to many of these; it can actually create lag.
So a basic example:
while true do wait() print'1' end print'2'
So in normal terms the print'2' will never be executed but...
spawn(function() while true do wait() print'1' end end) print'2'
if we do it like above the console will look somewhat like this...
--> 1 --> 2 --> 1 --> 1 --> etc
If you have any more questions let me know in the comments and i will get back with you asap