generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

How to check if all zombies dead?

Previous Thread :: Next Thread 
badfitz99 is not online. badfitz99
Joined: 01 May 2010
Total Posts: 5854
19 Jun 2014 11:27 AM
I'm making a zombie wave game, how can I check if all zombies are dead?

-- The scripter of Off-Topic -- ill gnaw ur arm off hagrid!
Report Abuse
4444vince2 is not online. 4444vince2
Joined: 08 Nov 2008
Total Posts: 4880
19 Jun 2014 11:28 AM
Put them in a model and use pairs to check all there humanoids to see if there dead. Easy as that. :D
Report Abuse
ShinobiBlue is not online. ShinobiBlue
Joined: 01 Nov 2009
Total Posts: 4177
19 Jun 2014 11:32 AM
Something like

while wait() do
Wkspc = game.Workspace:GetChildren()
if Wkspc.Name == "Zombie" and Wkspc.Humanoid.Health == 0 then
--stuff
end
end
Report Abuse
SenseiWarrior is online. SenseiWarrior
Joined: 09 Apr 2011
Total Posts: 12140
19 Jun 2014 11:33 AM
shinobi no
Report Abuse
DeSpizer27 is not online. DeSpizer27
Joined: 13 Jul 2012
Total Posts: 2679
19 Jun 2014 11:33 AM
for i,v in pairs(workspace:children()) do
if v.Name == "Zombie" and v.Humanoid.Health <=0 then
--stuff
end
end
Report Abuse
maxomega3 is not online. maxomega3
Joined: 11 Jun 2010
Total Posts: 10668
19 Jun 2014 11:36 AM
shin, you're forgetting the loop.

function BodyCount ()
count = 0
work = Workspace:GetChildren ()
for i,v in pairs (work) do
if v.Name == "Zombie" then
if v.Humanoid.Health == 0 then
count = count + 1
end
end
return count
end

BodyCount ()
Report Abuse
ShinobiBlue is not online. ShinobiBlue
Joined: 01 Nov 2009
Total Posts: 4177
19 Jun 2014 11:38 AM
That explains alot about my code that I'm working on...
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image