Modme Forums
Menu:

waittil the function is complete

Game Modding | Call of Duty: Black Ops 3 | Scripting


ModmeBot:

Thread By: hahaDuNOOB

someone know how to make a waittill the function is complete like

function test1
{
move test

waittill("function Test");//like the function need to complete done bevor let it go to move brush

move brush
}

function test()
{
   test move
   test move
   test move
   test move
   test move
   test move
   
}


ModmeBot:

Reply By: mathfag

Assuming you mean that when "function test" comes to an end a brush would move, then you can go 2 ways.

function test()
{

//do something before moving the brush

level thread function_that_moves_the_brush();   //go to the function that moves the brush
}

function function_that_moves_the_brush()
{

move brush

}



or you could do it your way

function init()
{
level.function_complete = 0;
}


function test1
{
level thread test

while(1);
{
waittill(level.function_complete >= 1); //without ""
if(level.function_complete == 1) //no ;
{
move brush
IPrintLnBold("brush should move");
}
}
}

function test()
{
   test move
   test move
   test move
   test move
   test move
   test move
   level.function_complete = 1; //this will trigger the waittil in the previous function. if you want to move the brush again from this location you will have to reset the value to 0

}




ModmeBot:

Reply By: hahaDuNOOB

mathfag

Assuming you mean that when "function test" comes to an end a brush would move, then you can go 2 ways.

function test()
{

//do something before moving the brush

level thread function_that_moves_the_brush();   //go to the function that moves the brush
}

function function_that_moves_the_brush()
{

move brush

}



or you could do it your way

function init()
{
level.function_complete = 0;
}


function test1
{
level thread test

while(1);
{
waittill(level.function_complete >= 1); //without ""
if(level.function_complete == 1) //no ;
{
move brush
IPrintLnBold("brush should move");
}
}
}

function test()
{
   test move
   test move
   test move
   test move
   test move
   test move
   level.function_complete = 1; //this will trigger the waittil in the previous function. if you want to move the brush again from this location you will have to reset the value to 0

}



thanks i thing that is what i need ill try it soone