Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

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

Asked by 4 years ago
Edited 4 years 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? User#30241 0 — 4y
0
I want to know how to do it, I dont know anything about how to make a player not die zandefear4 90 — 4y
0
Setting the health of the character's humanoid to 0 will most certainly kill the player. CeramicTile 847 — 4y

3 answers

Log in to vote
1
Answered by 4 years ago
Edited 4 years 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 17
4 years 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) User#30793 0 — 4y
1
Noone asked for this? G0ZZEN 17 — 4y
Log in to vote
0
Answered by
gloveshun 119
4 years ago

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

Answer this question