Question How do I continue a script after calling a thread?

Demon xModRx

Insane-Known Member
Messages
64
Reaction score
5
Points
358
So I've a script that loads when the game is started, and basically what the script does is call other scripts. Ex:
Code:
functionStart(){
    self function1();
    self function2();
    self function3();
}
but the issue is that function1() has a for( ;; ) loop in it, so function2() is never called, because the functionStart() is waiting for function1() to finish before continuing the script. is there a way to bypass this?
 

CF4_99

Veteran
Messages
145
Reaction score
57
Points
888
Any time you make a call to a function that runs a constant loop, or you want to immediately run the next line of code after the function call, make a thread to the function.
ex:

self thread function1(); //will execute the next line of code immediately
self function2(); //will execute the next line of code after this function is done executing(loops that never end will cause the next line to never be ran.)

so you will want to thread it.
self thread function1();
 
Top