Sounds like youre going the wrong way, this should go into the PLAYER action.
And you have to stick with HIT.skin2 as the entity structure doesnt have a
skin1 or skin2 property.

I take it your trying to get your player to change his brightness according
to the ground (shadowmap) underneath him.

Try this, just before the wait(1) at the end of the player-action main loop.
Code:
...
my.ambient = -55;
var fmt, pxl;	COLOR tmpC;
you = NULL;
c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_MAPS|IGNORE_MODELSS|IGNORE_SPRITES|SCAN_TEXTURE);
if(you)
{
	fmt = bmap_lock(hit.skin2,0);
	pxl = pixel_for_bmap(hit.skin2,hit.u2,hit.v2);
	bmap_unlock(hit.skin2);
	pixel_to_vec(tmpC, NULL, fmt, pxl);
	my.ambient = my.ambient + ((tmpC.red + tmpC.green + tmpC.blue) / 3);
}
...
...




"There is no fate but what WE make." - CEO Cyberdyne Systems Corp.
A8.30.5 Commercial