Revive system, Help Needed

So, I am making a game, where once you hit 1 hp, your health turns to 100, using your revive, kind of like a totem of undying on Minecraft.

My current system doesnt work on big damage systems, such as things that do 100 damage to players (instant kill)

Right now, Ive tried inserting/checking bool values before damaging, but still doesnt work on low hp people, nor instant kill things.

If you want to do stuff like this personally I would create my own health system with my own display so I can have much more control over what happens. E.g if I reach 1hp on my custom health system in reality I still have 100 hp so I won’t die and I can revive. (If I have a revive thingy) If not then simply set my actual health to 0

1 Like

How would i recreate the damage effect? like when you get damaged, and your screens turns red for a bit

I recommend having a Instance value and a .Changed that listens for whenever the value is changed, and have an “OldValue”. If the new changed value is lower than the oldvalue (which is logged from whenever it changes) then that means they have lost hp hence apply a damage effect

So
1.) Player is actually damaged
2.) Records Damage Value
3.) Instantly Heals player
4.) Damages the custom health bar?

No the custom health bar is what gets damaged, the actual player never loses hp. The only time they lose hp is when you want them to essentially be killed aka Humanoid.Health = 0

You can also use a large enough offset like: 1000 (=offset) + 100 (=actual health) and display it on your custom health bar as 1000 + 100 (=actual health) - 1000

1 Like

what did you mean by this?

i do not get it

You wouldn’t have to create a custom health system just do this

local damage = -- whatever damage the thing is doing
if damage > target.Humanoid.Health then
if target.Revive.Value == true then
target.Humanoid.Health = 1
end
end

and If you have a revive variable, which I assume you do have just check if the target has there revive variable up and if not then kill them

1 Like

Do this kind of but wrap the damage functions you use instead.

function TakeDamage(humanoid, damage)
if humanoid.Health > damage then
humanoid:TakeDamage(damage)
else
-- do revival stuff
end
end

yeah this should help a lot, this is for the actual damage part right? just to be clear.

Yeah, the point is you don’t need any custom health system, just wrap the damage currently. Where it says do revival stuff just have something to check if revival has already been done and if it hasn’t then set health to 100. Then use this function everywhere you damage.