SaintImmor
(SaintImmor)
October 17, 2024, 12:30am
#1
HealthModule
Simple , Safe and Smart way to handle health regeneration.
Details:
Details
Maid protected Runservice connection.
Type Annotated .
Protected Health Variable.
Ease of access (Client) (Constructor).
Better performance then Roblox Health Script.
Methods:
Methods:
New:
HealthModule.New() -- Returns All Module Functions, Recommended over manual use.
Regenerate:
HealthModule:Regenerate() -- Starts Regenerating Health
ToggleHealthRegeneration:
HealthModule:ToggleHealthRegeneration() -- Toggles if health is regenerated
SetRegenerationAmount:
HealthModule:SetRegenerationAmount() -- Sets Internal Regeneration Amount
SetRegenerationStep:
HealthModule:SetRegenerationStep() -- Sets Internal Regeneration Step (Wait)
ResetGeneration:
HealthModule:ResetGeneration() -- Resets the internal variables
AddHealth:
HealthModule:AddHealth() -- Adds any amount of health
SubtractHealth:
HealthModule:SubtractHealth() -- Subtracts any amount of health
Installation:
Installation
Download RBXM
Drag into studio
Place default Health script and Module into startercharacterscripts
Require module and call .New()
Call :Regenerate() Function
Download:
Download
Health Module
HealthModule.rbxm (5.2 KB)
Example Usage:
Example Usage
Damage Managing.
Health related abilities.
Securing Health Amount
Client/Server Side synced Damage (without need for networking)
3 Likes
S3CR3TH4CK
(Secrethack)
October 17, 2024, 1:48am
#2
Can you please add details like what makes it different from the normal health script and how its better? This post explains nothing about what the module is. Also I suggest you add the methods in a dropdown menu as they take too much space.
3 Likes
SaintImmor
(SaintImmor)
October 17, 2024, 2:38am
#3
The use of this system is for easily managing things like healing, healing boosts or powers.
It gives you easy access to a secured Health variable, letting you make sure that hackers cant exploit it or health hacks.
Its also more performant then the normal health script.
Its not a big project though, I typed it up in 20 minutes haha.
Thank you for the suggestions, ill be sure to do that!
can you add example uses for the methods? (im not going to use this, i just think it would be easier for others to understand)
2 Likes
SaintImmor
(SaintImmor)
October 17, 2024, 3:20am
#5
Of course, probably tommorow though.
1 Like
You should make set health where you can set the health of the player
1 Like
SaintImmor
(SaintImmor)
October 17, 2024, 4:14am
#7
It sets the health of the humanoid. Do you mean something else?
nvm idk what i was talking about before lol
1 Like
it looks like theres only Subtract and Add from what i can see. i think he wants an ability to literally set the health number manually
1 Like
There is a “currenthumanoidhealth” self variable. It’s for that use case.
In order to use it, do this:
Local HealthModule = require(path to module)
Local Healthmanager = HealthModule.New()
Healthmanager.currenthumanoidhealth = your number: number
1 Like
Using this, does it then allow players to die, but then not reset, so you could do other things while they are dead for as long as u want… like cut scenes, or watch other players , pop up messages etc?
Also an editable demo place or .rbxl is always helpful
Thanks
SaintImmor
(SaintImmor)
October 17, 2024, 5:44pm
#12
Technically yes, you could keep a player invulnerable for a little, or keep them at 1 or 0 health without them dying, its a state machine for health i guess
No reason for a place file, Rbxm is easier to use and its not a big project or anything
1 Like