Mh I tried that but it doesnt work with a wait() in the "test"-function...
That's exactly what Quad was saying.

He just gave you a heads up probably because your code example applies to that, not your real question:
function test()
{
//some code here
...
[SO NO WAIT HERE OR WHAT? OTHERWISE YOU CAN'T RETURN STUFF ANYWAY]
return 1;
}
function start()
{
while(test() == 0) //how can i wait for the end of the "test" function?
{
wait(1);
}
}