Ok:

Code:

//function to copy material states
material* mtl1;function mtl_copy(mtl_source){ mtl1 = mtl_source; vec_set(mtl.ambient_blue,mtl1.ambient_blue); vec_set(mtl.specular_blue,mtl1.specular_blue); vec_set(mtl.diffuse_blue,mtl1.diffuse_blue); vec_set(mtl.emissive_blue,mtl1.emissive_blue); mtl.power = mtl1.power;}


action enviro_map
{
my.ambient+=40;
my.shadow=on;
my.material=auge_mdl;
while(1)
{
my.pan+=5*time;
wait(1);
}

}

}

function mtl_rolleye_1();
function mtl_rolleye_2();
function mtl_eye_init();

//
function mtl_rolleye_2()
{
mtl.skill1 -= time; // shift eyeball right
if (mtl.skill1 < 0) { mtl.event = mtl_rolleye_1; }
mtl.matrix13 = floatd(mtl.skill1,500); // u offset
}
function mtl_rolleye_1()
{
mtl.skill1 += time; // shift eyeball left
if (mtl.skill1 > 50) { mtl.event = mtl_rolleye_2; }
mtl.matrix13 = floatd(mtl.skill1,500); // u offset
}

function mtl_eye_init()
{
// copy standard model material properties
mtl_copy(mat_model);
mtl.skill2 = 100; // initial texture scale in percent
mtl.matrix11 = float(1); // default u scale
mtl.matrix22 = float(1); // default v scale
mtl.event = mtl_rolleye_1;
mtl.enable_view = on;
}

material auge_mdl
{
event = mtl_eye_init;
effect = "
matrix matMtl;
texture entSkin1;
technique scale
{
// use material transformation matrix, leave everything else at default values
pass p0
{
Texture[0] = <entSkin1>;
ColorArg1[0] = Texture;
ColorArg2[0] = Current;
TextureTransformFlags[0] = Count2;
TextureTransform[0] = <matMtl>;
}
}

technique fallback { pass p0 { } }
";
}