Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How do I make NPC's spawn with more than 100 health?

I want one of my NPC's to have 300 max health, but when I play solo he spawns with 100/300 health. Is there a way to fix this or do I have to make a script to heal him every time he spawns?

2 answers

✓ Accepted answer

This script would go inside of the Humanoid of the NPC.

script.Parent.MaxHealth = 300
script.Parent.Health = 300
wait(1)
script:Destroy()

8 comments

0

Err. script.Parent.Health = 300 runs first. So the result would stay same as the explanation for question. Swap MaxHealth with Health

0

Oh yeah, thanks for finding that. I didn't notice until now.

0

Line 4 is an error, and will this work for each time he re spawns?

0

It was missing () after Destroy and yes. It will work each time they respawn.

0

He seems to spawn with 100/300 health like ever

0

Nevermind! I mixed up maxhealth and health! Thanks for helping me :D

0

No problem!

0

I told you to swap it :/

Well, I think there is a easier way to make npcs spawn with more than 100 health: Go to the NPC's Humanoid, Scroll down to Health and MaxHealth, Change MaxHealth to 300, Change Health to 300 It should now spawn with 300/300 health!

1 comment

0

First, I already got my answer and second that doesn't work. That is what I tried it the first place. For some reason It doesn't work in roblox.

This discussion is preserved as it was. New answers, comments, and votes are closed.