krisk7
|
  |
| Joined: 24 Aug 2013 |
| Total Posts: 254 |
|
|
| 18 Feb 2015 08:17 PM |
| So I have an NPC where I want his health to be 4000 but for some reason his health always goes down to 100 (and his maxhealth is also at 4000). I know there are health scripts that can put his health up to 4000 however when I regenerate the model his health automatically goes down to 100 and then a few seconds later his health goes up to 4000. So what I'm wondering is. Is there a way to make the NPC's health instantly go to 4000 as so as it's regenerated? |
|
|
| Report Abuse |
|
|
BioMatrix
|
  |
| Joined: 22 Mar 2014 |
| Total Posts: 693 |
|
|
| 18 Feb 2015 08:18 PM |
| is max health and total health both at 4000. Also make sure there isnt a script in the model changing the humanoids health. |
|
|
| Report Abuse |
|
|
krisk7
|
  |
| Joined: 24 Aug 2013 |
| Total Posts: 254 |
|
|
| 18 Feb 2015 08:43 PM |
| I know maxhealth and total health are at 4000 however are you saying that the NPC's health isn't supposed to automatically go down to 100 each time? |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 18 Feb 2015 08:51 PM |
that is just how they work
you must set the health to maxhealth after the game starts |
|
|
| Report Abuse |
|
|
krisk7
|
  |
| Joined: 24 Aug 2013 |
| Total Posts: 254 |
|
|
| 18 Feb 2015 09:06 PM |
| I also have another problem. Sometimes when I regenerate the NPC, the NPC dies. Why does that happen? It doesn't happen all the time but sometimes when I regenerate the NPC, the NPC dies. Do I have to do a certain type of regenerate script? |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 18 Feb 2015 09:12 PM |
is it held together with motor6D's?
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2015 11:36 PM |
/are you using MakeJoints on the model?
~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~ |
|
|
| Report Abuse |
|
|
krisk7
|
  |
| Joined: 24 Aug 2013 |
| Total Posts: 254 |
|
|
| 20 Feb 2015 12:34 AM |
| I don't think it is but what are motor6D's? |
|
|
| Report Abuse |
|
|
krisk7
|
  |
| Joined: 24 Aug 2013 |
| Total Posts: 254 |
|
|
| 20 Feb 2015 12:45 AM |
@nicemike40 I'm using /MakeJoints in the regen script but what do you mean by using /MakeJoints on the model? |
|
|
| Report Abuse |
|
|
|
| 20 Feb 2015 01:30 AM |
I just meant in your regen script, so you're good.
~Upload code to codepad-dot-org with Lua syntax highlighting to preserve indentation and make it easier to read!~ |
|
|
| Report Abuse |
|
|
krisk7
|
  |
| Joined: 24 Aug 2013 |
| Total Posts: 254 |
|
|
| 20 Feb 2015 09:07 PM |
I have one more quesiton. So what I'm trying to do is make the health script into a touch brick. This means that when the player touches a brick, the health of the NPC will go to 4000 (and the maxHealth is already at 4000). I've already tried to make something like that but it's not working. So what do I have to do get this to work?
function onTouched(part) local humanoid = script.Parent:waitForChild("NPC") if (humanoid ~= nil) then humanoid.Health = 4000 end end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|