|
| 01 Jan 2014 10:33 AM |
here it is,pretty simple,yet nothing happens,not even any output..
A = script.Parent function OnTouched (hit) if hit.Parent ~=nil then local h = hit.Parent:FindFirstChild("Humanoid") if h~=nil then h.Health = h.Health -10 end end end A.Touched:connect (OnTouched) |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 10:36 AM |
bumpity bump... really?its a simple question.. |
|
|
| Report Abuse |
|
|
| |
|
misgav11
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 3418 |
|
|
| 01 Jan 2014 10:38 AM |
A = script.Parent function OnTouched (hit) if hit then local h = hit.Parent:FindFirstChild("Humanoid") if h then h.Health = h.Health -10 end end end A.Touched:connect(function(hit) OnTouched(hit) end) |
|
|
| Report Abuse |
|
|
| |
|
misgav11
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 3418 |
|
|
| 01 Jan 2014 10:46 AM |
| its findFirstChild not FindFirstChild |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 10:47 AM |
| ive used "FindFirstChild" before,but ok |
|
|
| Report Abuse |
|
|
| |
|
| |
|
misgav11
|
  |
| Joined: 21 Apr 2011 |
| Total Posts: 3418 |
|
|
| 01 Jan 2014 10:49 AM |
try:
local A = script.Parent |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 10:50 AM |
still nothing.. no output.. |
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 10:56 AM |
got a working script now:
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") if h~=nil then h.Health = 0 end end script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
|
| 01 Jan 2014 10:58 AM |
| :FindFirstChild() does not exist, however :findFirstChild() does |
|
|
| Report Abuse |
|
|