var can_press_space=1;//(global variable)yes can enter function
if(key_space==1 && can_press_space==1)
{
can_press_space=0;// disable ability to enter function over here
var distance_moved=0;
while(distance_moved<100)
{
can_press_space=0;//perhaps here
//move and increase distance_moved with the distance you move each frame
wait(1);
}
can_press_space=0;//or over here ,one of these 3 positions ?
}
if(key_space==0)can_press_space=1;//yes can enter function again..
also then use c_move or whatever method of moving