thane1326
|
  |
| Joined: 08 Apr 2009 |
| Total Posts: 867 |
|
|
| 25 Mar 2012 03:14 PM |
function onTouched(part) local h = part.Parent:findFirstChild("Health") if h~=nil then h.Value = h.Value -10 end end script.Parent.Back.Touched:connect(onTouched)
I have no idea why it doesnt work, I originaly had the "Health" set to NumberValue as it looks for a NumberValue in the brick. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
|
| 25 Mar 2012 03:21 PM |
local h = part.Parent:findFirstChild("Humanoid")
then
h.Health = h.Health -10 |
|
|
| Report Abuse |
|
|
thane1326
|
  |
| Joined: 08 Apr 2009 |
| Total Posts: 867 |
|
|
| 25 Mar 2012 03:25 PM |
I'm not trying to make it to kill a person, I want it to take 10 away from the Value I added to the brick.
"One cannot prevent war, only particapate in it." |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
| |
|
thane1326
|
  |
| Joined: 08 Apr 2009 |
| Total Posts: 867 |
|
|
| 25 Mar 2012 04:07 PM |
| Nah, I already fixed the problem. |
|
|
| Report Abuse |
|
|
nate890
|
  |
| Joined: 22 Nov 2008 |
| Total Posts: 21686 |
|
| |
|