Idle Regen Passive Ability.

Hello all, I am trying to create a passive ability which lets the player regen HP every 3 seconds when they stand still on the map. Once they start walking they no longer regen HP.

Can this be done with common event?

Thank you.
You could event this with a parallel common event, without any javascript. You'll need 4 variables to hold the player's x and y coordinates (2 for each).

Variable 1 = old x coordinate
Variable 2 = old y coordinate
Variable 3 = new x coordinate
Variable 4 = new y coordinate

Set variable 3 player map x
Set variable 4 player map x
if (variable 1 === variable 3) {
if (variable 2 === variable 4) {
Change HP: Entire Party +amount
}
}
Set variable 1 variable 3
Set variable 2 variable 4
Wait 180 frames
Thank you very much! 🙂

Original thread: https://forums.rpgmakerweb.com/threads/idle-regen-passive-ability.116507/