I am working on a shield for my halo game mode, but having problems.
I have a script that gives you back the amount of health you lost until your shield runs out, then it takes health. The problem is, I can't get a shield bar to shrink as you lose shield, it only grows to the right, where I want it to shrink to the left.
shield = 100
function onTakeDamage(ent,inf,att,dam)
if shield > 0 then
shield = shield - dam
local health = _PlayerInfo( ent, "health" );
_PlayerSetHealth(ent, health + dam )
local down = shield/10000
local B = 0.22 - down
_Msg(shield.." "..B.."\n")
_GModRect_Start( "effects/laserplane" );
_GModRect_SetPos( 0.02, .79, B, 0.07 );
_GModRect_SetColor( 255, 255, 255, 255 );
_GModRect_SetTime( 99999, 0, 0 );
_GModRect_Send( playerid, 2 );
else
end
end
function rem(playerid)
_GModRect_HideAll( playerid );
end