It doesn't take into account what's in the view. You can either have an always on light or one that can be switched on and off depending on how far away it is from the player(using vec_dist).

Code:

if((vec_dist(player.x, my.x) < my.distToggle && my.alwaysOn == off) ||(my.alwaysOn == on))




My User Contributions master list - my initial post links are down but scroll down page to find list to active links