|
| 15 Jul 2011 02:53 PM |
I'm trying to make an RPG character. His health and MaxHealth SHOULD both be 5000. But his Health keeps jumping down to 100. I put a script in him(not free model). But it still does it. Here's the script:
wait(20) script.Parent.Humanoid.MaxHealth = 5000 wait(0.5) script.Parent.Humanoid.Health = 5000
What's wrong with it? |
|
|
| Report Abuse |
|
|
352ynnhoj
|
  |
| Joined: 21 Sep 2010 |
| Total Posts: 1054 |
|
|
| 15 Jul 2011 02:54 PM |
| because the max health is higher then 100 it will reset the health to 100. I dont know why roblox does it. try a health regen script instead. |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
| |
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 15 Jul 2011 03:36 PM |
I tried that. Still resets to zero. Maybe ill just go with an RPG with the highest boss having 100 HP and all the swords hurt like 2-10.....that would be a lame RPG, though. |
|
|
| Report Abuse |
|
|
myrco919
|
  |
| Joined: 12 Jun 2009 |
| Total Posts: 13241 |
|
| |
|
|
| 16 Jul 2011 06:22 PM |
Could I use this script insted?(in the model) h = Script.Parent.Humanoid.Health while h = >5000 then wait(5) h = h + 5 end
|
|
|
| Report Abuse |
|
|
Flurite
|
  |
| Joined: 03 Apr 2011 |
| Total Posts: 5386 |
|
|
| 16 Jul 2011 06:39 PM |
| In Rbx.lua, it's >= for greater than or equal to, and <= for less then or equal to. |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 16 Jul 2011 07:03 PM |
here is health add script fixed: h = script.Parent.Humanoid while h.Health < 5000 then if h.MaxHealth < 5000 then h.MaxHealth = 5000 end h.Health = h.Health + 100 wait(0.1) --without this, MAJOR LAG THAT GAME FREEZES! end |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 16 Jul 2011 07:05 PM |
check if AI's torso has: Right Shoulder, Left Shoulder, Right Hip and Left Hip OR check if there is: Right Arm, Left Arm, Left Leg and Right Leg OR Check if AI has Torso because without Torso, AI dies all the time |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2011 03:24 PM |
| Ok, it doesnt literally kepp "dying", I meant it keeps dropping. |
|
|
| Report Abuse |
|
|
|
| 19 Jul 2011 03:34 PM |
| Ok, I made it a free model. Ik your not going to want to, but can you please use him see what's wrong with the scripts? There's too many to list them all. |
|
|
| Report Abuse |
|
|
| |
|
| |
|
| |
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 01 Aug 2011 11:03 AM |
| post link to the model(if it's a roblox insite link like www.roblox.com it's allowed) |
|
|
| Report Abuse |
|
|
64kingJOE
|
  |
| Joined: 16 Jan 2016 |
| Total Posts: 7078 |
|
| |
|
|
| 01 Aug 2011 11:11 AM |
>Maybe ill just go with an RPG with the highest boss having 100 HP and all the swords hurt like 2-10.....that would be a lame RPG, though.
No one would notice. The health bar doesn't show numbers. No one would ever know that everything has really low health. |
|
|
| Report Abuse |
|
|
|
| 01 Aug 2011 12:47 PM |
@Wil2 http://www.roblox.com/Zocktar-item?id=54571346 @DavidBowieEyes Yes, actually, I have a script that shows how much health the character has left. |
|
|
| Report Abuse |
|
|
Wil2
|
  |
| Joined: 01 Feb 2008 |
| Total Posts: 728 |
|
|
| 01 Aug 2011 03:04 PM |
fixed. I added a script in the humanoid called Health that's first line is wait(5) then it changes the health to the max health: wait(5) script.Parent.Health = script.Parent.MaxHealth --tested and works, it makes Health 5000 |
|
|
| Report Abuse |
|
|
Spectrumz
|
  |
| Joined: 22 Mar 2011 |
| Total Posts: 4338 |
|
|
| 01 Aug 2011 03:04 PM |
| Bumping 15 day old threads? |
|
|
| Report Abuse |
|
|