Tecara
|
  |
| Joined: 26 Jul 2012 |
| Total Posts: 145 |
|
|
| 28 May 2014 01:07 PM |
I try to do a health fix script that looks like this:
wait(1) local hum = script.Parent.Humanoid hum.Health = hum.MaxHealth
the MaxHealth is 500 but, whenever I test it out, the health automatically goes to 100. Any help solving this is appreciated. :) |
|
|
| Report Abuse |
|
|
|
| 28 May 2014 01:07 PM |
wait(1) local hum = script.Parent.Humanoid hum.MaxHealth = 500 hum.Health = 500 --idk, just to be certain? |
|
|
| Report Abuse |
|
|
samy22
|
  |
| Joined: 28 Sep 2008 |
| Total Posts: 2181 |
|
|
| 28 May 2014 01:09 PM |
| Is there a script/ health script making sure the Health doesn't go past it's max health? |
|
|
| Report Abuse |
|
|
|
| 28 May 2014 01:15 PM |
function waitForChild(parent, childName) while true do local child = parent:findFirstChild(childName) if child then return child end parent.ChildAdded:wait() end end
local Figure = script.Parent local Head = waitForChild(Figure, "Head") local Humanoid = waitForChild(Figure, "Humanoid") Humanoid.Health=100 -- Change 100 to the Maximum Health, the Script will do the Rest :D
while true do local s = wait(4) local health = Humanoid.Health if health > 0 and health < Humanoid.MaxHealth then health = health + 0.08 * s * Humanoid.MaxHealth if health * 1.05 < Humanoid.MaxHealth then Humanoid.Health = health else Humanoid.Health = Humanoid.MaxHealth end end end |
|
|
| Report Abuse |
|
|