Discuss Scratch
- Discussion Forums
- » Help with Scripts
- » Health regeneration?
- Scratchuser19213
- Scratcher
12 posts
Health regeneration?
I'm making a project that involves fighting as the main gameplay. However, I don't have any sort of health regeneration whatsoever. I would be appreciated if someone could help me with this script. The regeneration would start if the player doesn't take damage for a certain period of time, like the Roblox engine. (Which is what i'm going for.)
- Scratchuser19213
- Scratcher
12 posts
Health regeneration?
Oops. Misspell. “I would appreciate it” instead of “I would be appreciated”.
- Luke52712
- Scratcher
24 posts
Health regeneration?
Hello Scratchuser19213!
This is actually more simple than you would think!
We need to use the time function for this.
This is the script that checks for when the player hasn't taken damage for a certain amount of time:
Then, you will need the script that resets the timer when the player is attacked, which will use this block.
This is the basic essentials to it. Want to make a health system, need help with deciding when the player is attacked, or anything else? Just reply to this.
WIKIS SO YOU CAN SEE MORE ABOUT THIS:
Timer Value Wiki
Timer Block Wiki
Reset Timer Block Wiki
This is actually more simple than you would think!
We need to use the time function for this.
This is the script that checks for when the player hasn't taken damage for a certain amount of time:
when [timer] > (Amount of time you want to set until regen)After this, you can add whatever health system you want.
Then, you will need the script that resets the timer when the player is attacked, which will use this block.
reset timer
This is the basic essentials to it. Want to make a health system, need help with deciding when the player is attacked, or anything else? Just reply to this.
WIKIS SO YOU CAN SEE MORE ABOUT THIS:
Timer Value Wiki
Timer Block Wiki
Reset Timer Block Wiki
- Scratchuser19213
- Scratcher
12 posts
Health regeneration?
Thanks! I'll try this in my project! I can handle the health system since I have some coding experience. Hello Scratchuser19213!
This is actually more simple than you would think!
We need to use the time function for this.
This is the script that checks for when the player hasn't taken damage for a certain amount of time:when [timer] > (Amount of time you want to set until regen)After this, you can add whatever health system you want.
Then, you will need the script that resets the timer when the player is attacked, which will use this block.reset timer
This is the basic essentials to it. Want to make a health system, need help with deciding when the player is attacked, or anything else? Just reply to this.
WIKIS SO YOU CAN SEE MORE ABOUT THIS:
Timer Value Wiki
Timer Block Wiki
Reset Timer Block Wiki
- Discussion Forums
- » Help with Scripts
- » Health regeneration?