generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Game Design
Home Search
 

Why does my NPC's health keep going down to 100?

Previous Thread :: Next Thread 
krisk7 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. 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 is not online. chimmihc
Joined: 01 Sep 2014
Total Posts: 17143
18 Feb 2015 09:12 PM
is it held together with motor6D's?

Report Abuse
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
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 is not online. 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 is not online. 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
nicemike40 is not online. nicemike40
Joined: 19 Dec 2008
Total Posts: 1814
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Game Design
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image