Here is the entire piece.
Code:
var run_speed = 550;

function get_ambient()
{
	//	c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|SCAN_TEXTURE);
	//	my.ambient = -55;
	//	my.ambient = my.ambient + ((hit.red + hit.green + hit.blue) / 3);

	var fmt, pxl; COLOR tmpC;

	c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES|SCAN_TEXTURE);
	if(trace_hit)
	{
		my.ambient = -55;
		fmt = bmap_lock(hit.skin2,0);
		pxl = pixel_for_bmap(hit.skin2,hit.u1,hit.v1);
		bmap_unlock(hit.skin2);
		pixel_to_vec(tmpC, NULL, fmt, pxl);
		my.ambient = my.ambient + ((tmpC.red + tmpC.green + tmpC.blue) / 3);
	}
}
//




action guss()
{

	var anim_cycle;
	var ground_dist;
	VECTOR ground_00;
	
	player = my;
	c_updatehull(my,11);
	wait(1);
	//	set(my,SHADOW);
	my.material = mat_alphatest;
	while(1)
	{
		player_exists = 1;
		get_ambient();///////here I call it, obviously
		
		c_trace(my.x,vector(my.x,my.y,(my.z - 500)),IGNORE_ME|IGNORE_PASSABLE|IGNORE_SPRITES);//|USE_BOX
		if(hit.z != 0)
		{
			hit.z += 24;
			player.z = hit.z;
		}

		
		if(key_w == 1)
		{
			c_move(my,vector(run_speed*time_step/16,0,0),nullvector,IGNORE_PASSABLE|IGNORE_SPRITES|GLIDE);
			
			ent_animate(my,"run",anim_cycle,ANM_CYCLE);
			anim_cycle += 10 * time_step;
			anim_cycle %= 100;
		}
		
		if(key_any == 0)
		{
			ent_animate(my,"stand",anim_cycle,ANM_CYCLE);
			anim_cycle += 8 * time_step;
			anim_cycle %= 100;
		}
		
		my.pan -= mouse_force.x + mouse_force.x;
		
		wait(1);
	}
}




Everybody Poops.
here are some tutorials I made.
http://www.acknexturk.com/blender/