////////////////////////////////////////////////////////////////////////////////////////////////////////
//Health Script By: Alex Parks
//First we need to make the health as an integer for the script and what ever the bullet will be parcially named that will hurt it and also a number that will help out with calculating damage.
string DBullet;
integer Health;
integer Damage;
default
{
//When the script begins we need to have to set the health to 100%.
state_entry()
{
//This will set the health all the way to 100% again and start to make the text say the health left.
Health=100;
llSetTimerEvent(.001)
}
timer()
{
llSetText("Health: "+(string)Health,<1,1,1>,1);
}
//this is what will happen after it is hit by any other object.
collision_start(integer num_detected)
{
DBullet=llDetectedName(0);
if(llGetSubString(DBullet, 0,


{
if(llGetSubString(DBullet, 8, llStringLength(DBullet))==(integer))
{
Damage=llGetSubString(DBullet, 8, llStringLength(DBullet))
Health=Health - Damage;
if(Health > 0)
{
llSetText("Health: "+(string)Health,<1,1,1>,1);
}
else if(Health < 0)
{
Health=0;
llSetText("Health: "+(string)Health,<1,1,1>,1);
llSay(0, "You have died. Please remove the health pack and put it back on again to continue playing!"

}
}
}
}
}
}
////////////////////////////////////////////////////////////////////////////////////////////////////////
Just remember I had no chance to test this so it is up to you to fix it, or to contact me because I would be happy to fix it
