Got it fixed now, it detects the correct wall or ledge and now I am going to having him just hanging around.

Thanks
SuperKu.


Code:
action shimmy_move()
{
	my.skill100= 1502;
		
}

function move_ledge()
{
	VECTOR wall_ahead[3];
	while(1)
	{
	  
     vec_set (wall_ahead.x, vector (15, 0, -20)); // play with 70 and -20
     vec_rotate (wall_ahead.x, my.pan);
     vec_add (wall_ahead.x, my.x);
     result = (c_trace(my.x,wall_ahead.x,IGNORE_PASSABLE |IGNORE_ME | SCAN_TEXTURE));
     if(result > 0 && you)
     {
     	if(you.skill100 == 1502 && HIT_TARGET)
     	{

     	draw_point3d(hit.x,vector(50,50,255),100,3);
     		draw_text("Wall Hit...",10,10,vector(50,50,255));
     		}
     	}
 
     wait(1);
     
   }
}