If it is in a while loop just use break then.

Code:
function breaking()
{
    while(1)
    {
       if(x == 0)
       {
           do_this();
           break; // Stops the while loop and continues after it
       }
       wait(1);
    }
    // Here could be more code
}