nvm i found out the way i want it to work after a long search here is the code
Code:
mx=mouse_x;
my=mouse_y;
switch ((point_direction(x,y,mx,my)+45) div 90) {
case 1: face = UP; break;
case 2: face = LEFT; break;
case 3: face = DOWN; break;
default: face = RIGHT; break;
}