Hello everybody! I did a way to have more hearts for the player. When the player receives a damage, LunaLua takes a heart from virtual hearts of the code. This is the same system which is used in the original LunaDLL. The code is very simple. It consists in 4 easy conditionals and 2 variables:

First step: setting up 2 variables "vhearts" (virtual hearts of the code) and "heartLimit" (max. number of hearts for your player). Create them and assign them the value that you want.Second step: powerup system. It isn't perfect, but we'll keep the number of true hearts in 2 always, so the third heart will add 1 to the virtual hearts. After that, we need to keep the true hearts in 2 again:

Third step: the limit. That conditional will add 1 virtual heart everytime you acquire a powerup. That's why we created a second variable. Using the next conditional, the player won't get more hearts if the virtual hearts reached the limit:

--You've defined a number of hearts for some reason, no? if (vhearts > heartLimit) then vhearts = heartLimit; end

Fourth step: substract hearts. When the player hurts, the number of hearts will decrease logically. Do you remember that the true hearts are always fixed in 2? Well, when the player receives a damage there is 1 true heart substracted. We can compare that single heart with the amount of virtual hearts here:

Fifth step: keep the player alive. If we run the code as is now, the player will start the game with 1 heart only and if you have various hearts, you'll switch to small at the first hit and then you'll die. So we'll keep the player in big state when the character has more than 2 hearts: