I am not sure what you are asking, but if I understood you correctly... just attach this action to the entity you want to be illuminated:
action illuminate_me()
{
my.ambient=0;
var dist;
while(1)
{
dist=vec_dist(my.x,camera.x);
if(dist<100)
{
my.ambient=100-dist;
}
else
{
my.ambient=0;
}
wait(1);
}
}
if the camera is more than 100 away from your entity the entity is not illuminated, if the camera is closer than 100 to the entity then the closer the camera is the more it will be illuminated