@Blink: Try this
Code:
function Shield()
{
my.passable = on;
my.transparent = on;
my.red = 0;
my.green = 0;
my.blue = 255;
my.light = on;
you = my.parent;
vec_set(my.scale_x,you.scale_x);
vec_scale(my.scale_x,my.skill3);
var MaxEnergy;
MaxEnergy = my.skill1;
var Temp1;
while(you)
{
vec_set(my.x,you.x);
vec_set(my.pan,you.pan);
if(you.skill2 > 0){my.skill1 += min(my.skill1+you.skill2,MaxEnergy); you.skill2 = 0;}
if(you.skill1 < 100 && my.skill1 > 0)
{
my.alpha = my.skill2;
Temp1 = min(my.skill1,100-you.skill1);
my.skill1 -= Temp1;
you.skill1 += Temp1;
}
if(my.alpha > 0){my.alpha -= time_step;}
wait(1);
you = my.parent;
}
}
string ModelFileName;
function Shield_Activate(Pointer,ShieldEnergy,ShieldAlpha,ShieldScale)
{
you = Pointer;
if(you)
{
str_for_entfile(ModelFileName,you);
you = ent_create(ModelFileName,nullvector,Shield);
you.parent = Pointer;
you.skill1 = ShieldEnergy;
you.skill2 = ShieldAlpha;
you.skill3 = ShieldScale;
}
}
Add this at the top of the plBiped01.wdl (make a backup of that file before...)
and write this at the end of the action PlBiped01:
Shield_Activate(my,100,40,1.13);
The players armor is the shield enegy to start with.
I wasn´t able to test this so if you get any errors, just post your error message here.