|
| 09 Dec 2009 09:49 AM |
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") local c = part.Parent:findFirstChild("Body Colors") if h~=nil and if c~=nil then
h.Health = h.Health -10 wait(1) end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
gustav165
|
  |
| Joined: 11 Nov 2008 |
| Total Posts: 1981 |
|
| |
|
|
| 09 Dec 2009 09:55 AM |
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") local c = part.Parent:findFirstChild("Body Colors") if h~=nil and if c~=nil then -- do i have the lines positioned right?
h.Health = h.Health -10 wait(1) end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
gustav165
|
  |
| Joined: 11 Nov 2008 |
| Total Posts: 1981 |
|
|
| 09 Dec 2009 09:56 AM |
No you don't. You cant start a new if on an if statement O.o Fix: if h~=nil and c~=nil then |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:05 AM |
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") local c = part.Parent:findFirstChild("Body Colors") if h~=nil and c~=nil then
h.Health = h.Health -10 wait(1) end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:06 AM |
Ty and is there a way to tell if its a player not a zombie?
I feel kinda noobie makin' a zombie game but oh well |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:13 AM |
| Well most the time the Humanoid in a zombie is called "Zombie". |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:16 AM |
No RLR EVRY TIME i post this you say that. Its My Zombie Not Cruddy Free model |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:17 AM |
+ all of my guns wouldnt work if i changed the name
Or could i put a bool value in the zombie and if the (hit) brick has that then damage - 0 |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:18 AM |
I've said that once, I don't think i've ever said that sentence before in my life.
So, now. Take my advice and rename the Humanoid "Zombie". |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:19 AM |
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") local c = part.Parent:findFirstChild("Zomb") -- Zomb is a value in every zombie if h~=nil and c=nil then -- if c is really not there then
h.Health = h.Health -10 ---10 wait(1) end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:20 AM |
No! Then my hole place will be unplayuble |
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:24 AM |
Well would this work RLR
function onTouched(part) local h = part.Parent:findFirstChild("Humanoid") local c = part.Parent:findFirstChild("Zomb") -- Zomb is a value in every zombie if h~=nil and c=nil then -- if c is really not there then
h.Health = h.Health -10 -- then -10 wait(1) end end
script.Parent.Touched:connect(onTouched)
|
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:24 AM |
Or you'nno the script in the weapons, at the same place as the finding Humanoid part, you can add "or if hit.Parent:FindFirstChild("Zombie") then"
|
|
|
| Report Abuse |
|
|
|
| 09 Dec 2009 10:28 AM |
my gun scripts 30 guns/staffs/blasters
have (off teh top of head)
if hit == findFirstChild("Zomb")~=nil then blalbl findFirstChild("Humanoid")~=nil then BLBLBLB |
|
|
| Report Abuse |
|
|
| |
|