i have a modified code here, taken from the aum76 the npc code.
i tried to put it to my character, did a little modification (but not sure).
i want the rival to detect an entities. but the code seems not to work. frown

Code:
action pacman2()
{
	VECTOR temp [3];
	set(my, PASSABLE);
	while(!player) { wait(1); }
	pac2_ready = 1;
	while (1)
	{
		c_scan(my.x, my.pan, vector(360, 30, 1000), SCAN_ENTS | SCAN_LIMIT);
		if(you)
		{
			target_coin = you;
			vec_set(temp, you.x);
			vec_sub(temp, my.x);
			vec_to_angle(my.pan, temp);
			while(vec_dist (my.x, you.x) > 30)
			{
				my.skill22 += 5* time_step;
				c_move(my, vector(5*time_step, 0, 0), nullvector, IGNORE_PASSABLE | GLIDE);
				ent_animate(my, "frame", my.skill22, ANM_CYCLE);
				wait(1);
		        }
	        }
	   wait(1);
       }
}



what could be the problem with this?
thanks. ^_____^