In player's action i put this code.

if ((c_scan(my.x, my.pan, vector(45, 60, 60), ignore_me) > 0))
{
if(you.skill51!=yes)
{
you.skill51 = yes;
front=you; //front is an entity pointer
}
}

It successfully assign the front pointer to the scanned entity and turn it's skill51 on but it doesn't turn it back off when player is not facing him anymore frown any idea?