Right now i've probably tested this, it's not going how I wanted it to go...For some reason it still will give players health even when the level is above 4 (5 and above).
How can I make it so it only regenerates the health of players under level 5?
Code:
class RegenMut extends Mutator;
function PostBeginPlay()
{
SetTimer(1, true);
}
function Timer()
{
local KFHumanPawn Player;
local KFPlayerReplicationInfo KFPRI;
if (KFPRI.ClientVeteranSkillLevel <=4)
foreach DynamicActors(class 'KFHumanPawn', Player)
{
if (Player.Health + 2 <= Player.HealthMax)
(Player).Health += 2;
else
Player.Health = Player.HealthMax;
}
else return;
}
defaultproperties
{
GroupName="KFRegenMutator"
FriendlyName="KF Health Regeneration"
Description="Mutator that regenerates health depending on perk level."
}
How can I make it so it only regenerates the health of players under level 5?
Upvote
0