Thanks badapple for the fast reply.

There's something wrong still, after trying the solution, the AI cars will just stopped infront of the checkpoint (because it is a little higher on level ground). So i made the check point passable when it detects anything other than the player.

function checkpoint1_event(){
proc_kill(4);// so that there is only one instance of this function running

if (you==player)
{
add_laps_player();
time_left += 20;
my.flags |= PASSABLE;
wait(1000);
my.flags &= ~PASSABLE;
}
else {
my.flags |= PASSABLE;
wait(1);
my.flags &= ~PASSABLE;
}

}

But something is wrong still. One of the AI car will still stop infront of the checkpoint, and the checkpoint does not detect the player anymore.
What are the likely cause of it? Thanks alot for the help!