|
| 25 Nov 2014 09:41 AM |
I don't want the parts to scatter, I want them to instantly disappear after they die.
How do I do this? I'm not a very good scripter in lua yet |
|
|
| Report Abuse |
|
|
| |
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 25 Nov 2014 09:55 AM |
if zombie.Health == 0 then a = zombie:GetChildren()
for i = 1,#a if a[i].ClassName == "Part then a[i]:remove() end
end
Or just remove the whole model.
if zombie.Health == 0 then zombie:remove() |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2014 09:58 AM |
hex no
local zombie = script.Parent zombie.Humanoid.Died:connect(function() zombie:Destroy() end)
guise i have a siggy |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 25 Nov 2014 09:59 AM |
Just ADD humanoid before health.
like Humanoid.Health |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2014 10:00 AM |
hex, yours is inefficient cuz you'd have to loop check, plus remove is deprecated and doesn't completely remove parts.
guise i have a siggy |
|
|
| Report Abuse |
|
|
Egzekiel
|
  |
| Joined: 10 Jan 2011 |
| Total Posts: 1079 |
|
|
| 25 Nov 2014 10:00 AM |
zombie=script.Parent if zombie.Humanoid.Health==0 then zombie:Destroy() end |
|
|
| Report Abuse |
|
|
HexC3D
|
  |
| Joined: 30 Jun 2012 |
| Total Posts: 10044 |
|
|
| 25 Nov 2014 10:00 AM |
XDDDDDDD, I forgot.
There is an event/ plus the script runs before... Yeah I get.
I need to think before pressing 'Enter' |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2014 10:11 AM |
| looks to me like egz' and dev's are about the same, so I'll try and see if either of them work. Thanks guys for the help. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2014 10:15 AM |
| Weird, looks like ever since I put the script in, the zombies don't spawn at all. |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2014 10:24 AM |
| Both egz' and dev's have the same result - no zombies spawn |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2014 10:46 AM |
are they spawning dead?
guise i have a siggy |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2014 10:50 AM |
Usually when they spawned before there were very few that spawned dead and then scattered into pieces, but most of them spawned with 95% health and they do not have health regeneration.
Now they just don't spawn at all |
|
|
| Report Abuse |
|
|
|
| 25 Nov 2014 10:52 AM |
If you want to see what's going on, here is the game:
http://www.roblox.com/Five-Nights-of-ZOMBIES-place?id=144931698
The zombies spawn in the center of the map, I'm trying to remake Shaakra's Zombie Defense Tycoon, and I'm gonna make it better. |
|
|
| Report Abuse |
|
|
| |
|
|
| 25 Nov 2014 05:12 PM |
Nvm dev, it was an issue I created, sorry lol
Your script works fine |
|
|
| Report Abuse |
|
|