Author Topic: Some regenerating help...  (Read 435 times)

I got this regenerating health script from DrenDran's Dogfight playertypes and I was wondering if it is editable. I need it's regen rate to heal 250hp in about 20-30 seconds, after 5 seconds of no damage.

I didn't see anywhere I could edit the rate, but I'm a noob scripter, so.. yeah.

Code: [Select]
function RecoverHealth(%player)
{
if(!isObject(%player)) return;

%damage = %player.getDamageLevel();
%player.setDamageLevel(%damage - 1);
%stamina = %player.getEnergyLevel();
%amount = 20000/(%damage+10)+500-%stamina*5;

if(%damage > 0) %player.recoverSched = schedule(%amount, 0, "RecoverHealth", %player);
}

Also, if there's a different script to regenerate health that is editable, it would be greatly appreciated if someone posted it here.

In this function, %amount is the time schedule that's used to add health. %amount is also known as 20000/(%damage+10)+500-%stamina*5. %damage is the player's damage level (health) and %stamina is his energy bar.

I would just suggest that you tinker around with it until you find what you want. Note that adding more to 20000 will make the delay longer and less will make it shorter.

« Last Edit: September 17, 2011, 07:02:09 PM by Kevune »