Lives

I am making a game where if you collect 100 energy capsules you get an extra life, I have all the text actors to do it but I am not sure how to do it.
Capsule += 1; // the "Capsule" is an integer variable which you create yourself
if(Capsule > 100)
{Lives += 1;} // the same goes for "Lives"
Capsuletextactor.textNumber = Capsule;
Capsule - 0
Capsule ++;
if (Capsule >= lifeScore)
{
Lives ++;
lifeScore += 100;
}