Let's see if I can explain this properly. I have a system that gives the player a timed reward, Crossy Road style free gift after increasing intervals of time, eventually ramping up to every 6 hours. A lives system would be the same thing minus the increasing delay.
I have a game attribute called lastSavedTime.
I have a game attribute called resetTimer.
I have 3 local attributes: timeStart, timeCurrent, and timeEnd.
lastSavedTime is set to the 'get current timestamp' block from the Date extension, triggered whenever it's required (in a lives system, that would be when you lose a life).
timeStart is set to lastSavedTime.
timeEnd is set to resetTimer.
timeCurrent is set to 'get current timestamp' every second, *if* [timeEnd + floor of [convert timeStart - timeCurrent milliseconds to seconds]>0]
when [timeEnd + floor of [convert timeStart - timeCurrent milliseconds to seconds] becomes <0, the required action is triggered to happen (in your case restock a life. Then either start over if the player has lost more lives, or just stop the whole process until another life is lost)
So basically what you're doing is setting a starting point as a number, an ending point as another number, you compare the difference until they become equal, and that triggers an action. Using game attributes for the start and end points is important because it means the game can function when the device is closed. what will happen when the game is opened again after 18 hours, timeStart is still set to 18 hours ago, timeCurrent is set to now, and since timeEnd is way lower than the difference of 18 hours, the action will be triggered. (note: and for a lives system you could add another calculation where if [timeEnd + floor of [convert timeStart - timeCurrent milliseconds to seconds] is 2,3,4x lower than timeEnd, replenish 2,3,4 lives instead of 1)