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

How do i make a humanoid have infinite health?

Asked by 7 years ago

i know soem people will say tp put the health to 999999, but someones ganna want to challenge the npc until its 99999 health is down, so will i have to use a debounce oris it a humanoid property?

3 answers

Log in to vote
1
Answered by 7 years ago

I think your best bet is to make it simply unkillable. So once its health becomes lower than its maximum, it becomes the maximum.

------ You have not showed your code, so I cannot really start this off. Add a "local Character = way to the humanoid's parent"
local human = Character:WaitForChild("Humanoid")
human.HealthChanged:connect(function(health)
wait()
human.Health = human.MaxHealth
end

There might be an error, I'm not sure. I just made this and did not test in studio. Make sure the Max Health is something that is high enough, so it cannot be one shot killed.

0
I agree, however the wait is unnecessary. Any unnecessary delay is a bad delay. User#11440 120 — 7y
0
the wait() is pretty needed. It has no specific time, but here is the thing. It simply waits for the game to catch up, or at least I believe so. iamnoamesa 674 — 7y
Ad
Log in to vote
1
Answered by 7 years ago

There is a point where the numbers can't go any higher in ROBLOX so not exactly.

0
@shasta342 yes just make sure it's in a LocalScript andrewboy159 18 — 7y
Log in to vote
1
Answered by 7 years ago
local player = game.Players.LocalPlayer
local humanoid = player.Character:WaitForChild("Humanoid")

humanoid.MaxHealth = math.huge
0
That should work :) Jesus loves you man :D Bless you shasta342 37 — 7y

Answer this question