put
while(!player) wait(1);

at the very begining of the action.


3333333333