Well, it's still more or less the same code, but now you have to stick it all inside another Fork that checks the player's maximum health and, if the current health is below the maximum health, draws the appropriate number of empty hearts before switching to filled hearts. Assuming the player starts with three hearts and can obtain a total possible of four hearts, the code would look like this:
Fork Option:Varbl(0001:MaxHP)-4
Fork Option:Varbl(0001:CurrentHP)-4
Show Picture 1, FilledHeart1 (30,10)
Show Picture 2, FilledHeart2 (50,10)
Show Picture 3, FilledHeart3 (70,10)
Show Picture 4, FilledHeart4 (90, 10)
End Case
Fork Option:Varbl(0001:CurrentHP)-3
Show Picture 1, FilledHeart1 (30,10)
Show Picture 2, FilledHeart2 (50,10)
Show Picture 3, FilledHeart3 (70,10)
Show Picture 4, EmptyHeart4 (90, 10)
End Case
Fork Option:Varbl(0001:CurrentHP)-2
Show Picture 1, FilledHeart1 (30,10)
Show Picture 2, FilledHeart2 (50,10)
Show Picture 3, EmptyHeart3 (70,10)
Show Picture 4, EmptyHeart4 (90, 10)
End Case
Fork Option:Varbl(0001:CurrentHP)-1
Show Picture 1, FilledHeart1 (30,10)
Show Picture 2, EmptyHeart2 (50,10)
Show Picture 3, EmptyHeart3 (70,10)
Show Picture 4, EmptyHeart4 (90, 10)
End Case
Fork Option:Varbl(0001:CurrentHP)-0
Erase Picture 1
Erase Picture 2
Erase Picture 3
Erase Picture 4
Game Over
End Case
End Case
Fork Option:Varbl(0001:MaxHP)-3
Fork Option:Varbl(0001:CurrentHP)-3
Show Picture 1, FilledHeart1 (30,10)
Show Picture 2, FilledHeart2 (50,10)
Show Picture 3, FilledHeart3 (70,10)
End Case
Fork Option:Varbl(0001:CurrentHP)-2
Show Picture 1, FilledHeart1 (30,10)
Show Picture 2, FilledHeart2 (50,10)
Show Picture 3, EmptyHeart3 (70,10)
End Case
Fork Option:Varbl(0001:CurrentHP)-1
Show Picture 1, FilledHeart1 (30,10)
Show Picture 2, EmptyHeart2 (50,10)
Show Picture 3, EmptyHeart3 (70,10)
End Case
Fork Option:Varbl(0001:CurrentHP)-0
Erase Picture 1
Erase Picture 2
Erase Picture 3
Game Over
End Case
End Case
It's a lot of code, but the good news is that once you set up the Fork for the maximum possible hearts, you can really just copy/paste it for all the others and change what value of MaxHP it's checking for.