Basically what I mean by this is something like this
1 | local function test() |
2 | print ( 'abc' ) |
3 | wait( 1 ) |
4 | end |
5 |
6 | test() |
7 | print ( 'this printed one second after abc assuming server didnt wait longer' ) |
What I want to do is make that second print() occur right after abc is printed while still having the wait in the function
You cannot remove a yield from a script but you can use spawn or even delay
More infomation can be found on the threading wiki page.
Example:-
1 | local function test() |
2 | print ( 'abc' ) |
3 | wait( 1 ) |
4 | print ( 'test end' ) |
5 | end |
6 |
7 | spawn(test) |
8 | print ( 'this printed one second after abc assuming server didnt wait longer' ) |
I hope this helps.