|
| 30 Aug 2011 07:14 PM |
This is part of a zombie script but it kills instantly. How would i make it kill 10 health every 2 seconds? Please help im a begginer at scripting
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
wait(0.001) h.Health = 0 children = h.Parent:children()
for i=1,#children do
if(children[i].className == "Part" and children[i].Name ~= "Torso") then stick(children[i], h.Parent.Torso) end
if(children[i].className == "Hat") then stick(children[i].Handle, h.Parent.Torso) end
end
h.Parent.Head.Velocity = h.Parent.Head.Velocity + Vector3.new(5,0,0)
end
end
script.Parent.Touched:connect(onTouched) |
|
|
| Report Abuse |
|
|
| |
|
| |
|
Colt324
|
  |
| Joined: 19 Aug 2009 |
| Total Posts: 1562 |
|
|
| 30 Aug 2011 07:20 PM |
function onTouched(part)
local h = part.Parent:findFirstChild("Humanoid")
if h~=nil then
wait(0.001) h.Health = 90 wait(2) h.Health = 80 wait(2) h.Health = 70 wait(2) h.Health = 60 wait(2) h.Health = 50 wait(2) h.Health = 40 wait(2) h.Health = 30 wait(2) h.Health = 20 wait(2) h.Health = 10 wait(2) h.Health = 0 children = h.Parent:children()
for i=1,#children do
if(children[i].className == "Part" and children[i].Name ~= "Torso") then stick(children[i], h.Parent.Torso) end
if(children[i].className == "Hat") then stick(children[i].Handle, h.Parent.Torso) end
end
h.Parent.Head.Velocity = h.Parent.Head.Velocity + Vector3.new(5,0,0)
end
end |
|
|
| Report Abuse |
|
|