xLawOut
|
  |
| Joined: 28 Feb 2015 |
| Total Posts: 1782 |
|
|
| 26 Feb 2017 12:05 PM |
| function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h~=nil then h.Health = 20 wait(45) h.Health = 15 wait(45) h.Health = 10 wait(45) h.Health = 5 wait(45) h.Health = 0 end end script.Parent.Touched:connect(onTouched) I have this script. it's supposed to work ONLY when the humanoid's health is 25 or below. it's linked to a bleeding script for my game. so if the player has low health and gets damaged again he slowly dies off if he doesn't get his health back up to higher than 25. it's a 1 line of code and I can't seem to ## #### |
|
|
| Report Abuse |
|
|
xLawOut
|
  |
| Joined: 28 Feb 2015 |
| Total Posts: 1782 |
|
|
| 26 Feb 2017 12:06 PM |
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h~=nil then h.Health = 20 wait(45) h.Health = 15 wait(45) h.Health = 10 wait(45) h.Health = 5 wait(45) h.Health = 0 end end
script.Parent.Touched:connect(onTouched)
I have this script.
it's supposed to work ONLY when the humanoid's health is 25 or below.
it's linked to a bleeding script for my game.
so if the player has low HP and gets damaged again he slowly dies off if he doesn't get his health back up to higher than 25.
it's a 1 line of code and I can't seem to make it..
|
|
|
| Report Abuse |
|
|
|
| 26 Feb 2017 12:08 PM |
| if h~=nil and h.Health < 25 then |
|
|
| Report Abuse |
|
|
xLawOut
|
  |
| Joined: 28 Feb 2015 |
| Total Posts: 1782 |
|
|
| 26 Feb 2017 12:10 PM |
I KNEW IT HAD TO DO WITH "h. Health = <25 then"!
well anyways thanks.
also this makes me feel stupid now..
|
|
|
| Report Abuse |
|
|