The problem is that only one entity gets a pointer, even if there are multiple entities assigned the same action, so the way you have it set up should only work if there is one light.
There is only one player however. So you can set it up differently:
Code:
action dynLights //I like shorter names (:
{
while(!player) { wait(1); } //wait for player to exist
while(player)
{
my.light = (vec_dist(my.x,player.x) < 500); //turn on light if in range
my.lightrange = 500 * (vec_dist(my.x,player.x) < 500); //set lightrange if in range
wait(1);
}
}
Just be sure you have player = my at the top of your player code. Player is an engine defined pointer.
And what you have in the while are conditionals, its just a shorter way of doing an if-branch because conditionals always return 1 or 0. So if player is 600 away from the light my.light = 0;, therefore the light is off. my.lightrange = 500 * 0 = 0;, therefore there is no lightrange.
Dynamic lights are available in Extra. Colored are not.