New: Nitro Boost our Discord server and receive full donation perks here on the website! Join the Scripting Helpers Discord Server to learn more! You can also Support on Patreon as always.
Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

How to make a player not die when they get down to 0 health?

Asked by 10 days ago
Edited 10 days ago

How would you make it so that once the player gets down to zero health, he doesn't die but drops on the floor or something? Is there a script that I would have to disable and then re enable? Is there a way to change its state if the player is dead?

0
Is this a request? Popularjon321 23 — 10d
0
I want to know how to do it, I dont know anything about how to make a player not die zandefear4 21 — 10d
0
Setting the health of the character's humanoid to 0 will most certainly kill the player. CeramicTile 538 — 10d

3 answers

Log in to vote
0
Answered by 9 days ago
Edited 9 days ago

I think your best bet would be making a script that fires every time the humanoid's health changes (using the :GetPropertyChangedSignal("Health") function), and if it is 0, it sets it to 1 and makes the character ragdoll. You will have to make sure to disable the regen script and whatnot, but I see no reason for it to not work. I'm pretty sure you can find a tutorial on this somewhere.

The other option, like G0ZZEN said, is to make the player ragdoll when it dies and then either make the respawn time really long or disable it entirely. Mind that you will need to manually spawn and respawn players. If you want a revive system, this might not be the best choice, but it depends on what you need.

Ad
Log in to vote
1
Answered by
G0ZZEN 15
10 days ago

Let him fall to the floor with 10 or 5 health. I think 0 Health is an instant death. Or just add a ragdoll when he dies and extend the respawn time.

0
local Player = game.Players.LocalPlayer local Character = Player.Character local Humanoid = Character.Humanoid print('Godmode working.') Humanoid.MaxHealth = 999999 Humanoid.Health = Humanoid.MaxHealth / 2 Humanoid.HealthChanged:connect(function() if Humanoid.Health < 10 then Humanoid.Health = Humanoid.MaxHealth end end) Brayden_V86 8 — 10d
1
Noone asked for this? G0ZZEN 15 — 10d
Log in to vote
0
Answered by 10 days ago

No way, if a Humanoid has health 0, then the humanoid dies!

Answer this question