i want to call function2 through function1, but function2 has a wait() command in it, but i want function1 to keep going and not have to wait for it, i tried to use remote events but it doesnt work because im using server to server
Use coroutines.
1 | coroutine.wrap( function () |
2 | -- Your code here |
3 | end )() |
If you want to give it a name, do this:
1 | local myFunc = coroutine.create( function () |
2 |
3 | end ) |
4 |
5 | coroutine.resume(myFunc) |
Use spawn..
1 | spawn( function () |
2 | -- script |
3 | end ) |