Envision, Create, Share

Welcome to HBGames, a leading amateur game development forum and Discord server. All are welcome, and amongst our ranks you will find experts in their field from all aspects of video game design and development.

Auto-Recharge Health/MP

Hey there!  :grin:
I Need a script:

What the script does is make it where you recharge health and mp over a period of time.

Eg. 3hp -> every 9 seconds

Now remember, I need one for hp, and one for mana, or one for hp and mana  :thumb:

Thankyou!
(Credits will be given to whoever makes the script)
 
You don't necessarily need a script for this-- a parallel process common event that waits for, say, 60 frames, then raises one stat or the other would work just fine, and be very easy to create.
 
I've been doing some thinking and studying. I think it is time for my first script. This seems simple enough, and I need it myself, so I'll write this one for you...hopefully. If I can't get it by tomorrow anyone can take the job.
 
What did you put in the common event?
It should look something like
player[some player] hp + x-amount (or sp or both, I'm sure you can find those commands)
wait 60 frames

either just have that run parallel when a switch is on, or copy the first 2 commands for however many seconds you want the effect to last and call the effect from an item...something like that would proly do the trick.
 
Just make a common event. Set the trigger to parallel process. Activate the switch whenever you want this to happen. Then tell the common event to wait a certain amount of frames, and raise HP. Then raise a variable by one. When  that varibale reaches the amount that you want, tell th common event to turn the switch off and the process will stop.
 

Thank you for viewing

HBGames is a leading amateur video game development forum and Discord server open to all ability levels. Feel free to have a nosey around!

Discord

Join our growing and active Discord server to discuss all aspects of game making in a relaxed environment. Join Us

Content

  • Our Games
  • Games in Development
  • Emoji by Twemoji.
    Top