|
| 18 Feb 2013 05:50 PM |
if script.Parent.Humanoid.Health == 0 then script.Parent:Destroy() end
script.Parent is the model script.Parent.Humanoid is the humanoid in the model There is also a head inside of the model
|
|
|
| Report Abuse |
|
|
|
| 18 Feb 2013 05:53 PM |
if script.Parent.Humanoid.Health == 0 then print("line one") script.Parent:Destroy() print("line 2") end print("line 3")
post the output |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Feb 2013 06:05 PM |
script.Parent.Humanoid.Died:connect(function() game.Debris:AddItem(script.Parent,2) end)
Assuming this is what You want.
What you posted won't work because it fires when the Character loads, and the Health wouldn't be 0, it never rechecks. |
|
|
| Report Abuse |
|
|
|
| 18 Feb 2013 06:29 PM |
@the
I'll try that, thanks for the tip |
|
|
| Report Abuse |
|
|
| |
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
|
| 18 Feb 2013 06:33 PM |
while wait() do if script.Parent.Humanoid.Health <= 0 then script.Parent:Destroy() end end |
|
|
| Report Abuse |
|
|
| |
|
|
| 18 Feb 2013 06:36 PM |
The horror...a while loop D:
script.Parent.Humanoid.HealthChanged:connect(function(floaty) if floaty <= 0 then script.Parent:Destroy() end end) |
|
|
| Report Abuse |
|
|
Xnite515
|
  |
| Joined: 18 Feb 2011 |
| Total Posts: 22763 |
|
| |
|