kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 20 Jan 2013 11:19 AM |
Just fix this script its broken... I want it to loose health when a brick touches it. I made it so it looses all health. cant figure out how to make it loose 1 health...
function onTouch(part) script.Parent.Parent.Humanoid.Health - 1 end script.Parent.Touched:connect (onTouch) |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 20 Jan 2013 11:22 AM |
local db = true script.Parent.Touched:connect(function(hit) if not hit.Parent:findFirstChild("Humanoid") and db then db = false print("not hit by a player") script.Parent.Parent.Humanoid.Health = script.Parent.Parent.Humanoid.Health - 1 --idk that you have this pointing to the correct location end end)
|
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 20 Jan 2013 11:23 AM |
local db = true script.Parent.Touched:connect(function(hit) if not hit.Parent:findFirstChild("Humanoid") and db then db = false print("not hit by a player") script.Parent.Parent.Humanoid.Health:TakeDamage(1) --idk that you have this pointing to the correct location wait(1) db = false end end) |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 20 Jan 2013 11:29 AM |
Not a lava script............
I have a humanoid called monkey home and i want it to loose health when any old brick touches it. Thats why the script i had before was so simple. i |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 20 Jan 2013 11:30 AM |
| ik that's why I made it so when a player touches it, nothing happens. |
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
|
| 20 Jan 2013 11:35 AM |
how could you go from this
function onTouch(part) script.Parent.Parent.Humanoid.Health = 0 end script.Parent.Touched:connect (onTouch)
to that?
The script above works i just want it to - 1 health. ill use urs and test it. |
|
|
| Report Abuse |
|
|
Azarth
|
  |
| Joined: 17 Aug 2012 |
| Total Posts: 2760 |
|
|
| 20 Jan 2013 11:36 AM |
script.Parent.Parent.Humanoid.Health = script.Parent.Parent.Humanoid.Health - 1
|
|
|
| Report Abuse |
|
|
kingmatt2
|
  |
| Joined: 20 Aug 2011 |
| Total Posts: 6494 |
|
| |
|