Mana Regeneration

Discussion in 'Plugin Development' started by plisov, Aug 1, 2017.

Thread Status:
Not open for further replies.
  1. Offline

    plisov

    I'm making an RPG plugin and have been trying to implement mana regeneration. I'm trying to make a number 20/20 and everytime a spell is cast, a certain amount is removed from the 20 and over time the number regenerates back up to 20. I'm storing the player's current mana level in a config named Current-Mana and the max mana as Max-Mana. The removing numbers is pretty self explanatory but the regeneration part, not so much. How do I constantly check if the current mana is less than the max-mana and if it is regenerate it?
     
  2. Offline

    Caderape2

    @plisov a runnable every X minuts, then loops online players and check the amount of mana.
     
  3. Offline

    jakemaster2003

    And if lower then the config value of max mana then add a certain amount that you like you can even make it an option for in the config but if the regeneration wil add like 2 evey minute but the max is 20 then check after that if its not higher than the max so yes then set it to the maximum value
     
Thread Status:
Not open for further replies.

Share This Page