DeactivatePackage(Healthbar); package Healthbar { function Armor::onDamage(%this, %obj, %amt) { if(isObject(%obj.client)) %obj.client.healthBar(); Parent::onDamage(%this, %obj, %amt); } function GameConnection::spawnPlayer(%client) { Parent::spawnPlayer(%client); %client.healthBar(); } }; ActivatePackage(Healthbar); function GameConnection::healthBar(%client) { %bar = client_healthbar(%client.player.getHealth() / %client.player.getMaxHealth(), 11); BottomPrint(%client, "<" @ %bar @ ">", 30); } function client_healthbar(%percent, %amt) { %end = mFloor(%percent * %amt); %color_set = false; if(%percent != 0) %text = ""; else %text = "\c7"; for(%i = 0; %i < %amt; %i++) { if(%i > %end && !%color_set) { %text = %text @ "\c7\xD7"; %color_set = true; } else { %text = %text @ "\xD7"; } } return %text; }