Code:

while(1)
{
if(vec_dist(my.x,player.x) > 500)
{
my.invisible = on;
} else {
my.invisible = off;
}
wait(1);
}



Not sure why you've to test the "clipped" flag? your code
works fine without it.