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

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

Asked by 10 years ago

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

Log in to vote
3
Answered by
TofuBytes 500 Moderation Voter
10 years ago

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

script.Parent.MaxHealth = 300
script.Parent.Health = 300
wait(1)
script:Destroy()
0
Err. script.Parent.Health = 300 runs first. So the result would stay same as the explanation for question. Swap MaxHealth with Health fireboltofdeath 635 — 10y
0
Oh yeah, thanks for finding that. I didn't notice until now. TofuBytes 500 — 10y
0
Line 4 is an error, and will this work for each time he re spawns? Jatrick 5 — 10y
0
It was missing () after Destroy and yes. It will work each time they respawn. TofuBytes 500 — 10y
View all comments (4 more)
0
He seems to spawn with 100/300 health like ever Jatrick 5 — 10y
0
Nevermind! I mixed up maxhealth and health! Thanks for helping me :D Jatrick 5 — 10y
0
No problem! TofuBytes 500 — 10y
0
I told you to swap it :/ fireboltofdeath 635 — 10y
Ad
Log in to vote
0
Answered by 10 years ago

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!

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. Jatrick 5 — 10y

Answer this question