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 » Scripters
Home Search
 

How to make a script get the amount of children in a place?

Previous Thread :: Next Thread 
CrimsonSparkleTime is not online. CrimsonSparkleTime
Joined: 25 Feb 2016
Total Posts: 2161
03 Apr 2017 04:39 AM
I need it to count how many items there are and if it's over a specific amount then it will teleport them.


R$0
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
03 Apr 2017 04:46 AM
in the entire game?

local children = 0

local function count(c)
for i, v in next, c:GetChildren() do
children = children + 1
count(v)
end
end

if children > 9000 then
print 'its over 9000!'
end


capitalist atheist
Report Abuse
Disillusions is not online. Disillusions
Joined: 10 Jul 2011
Total Posts: 6365
03 Apr 2017 04:47 AM
whoops you need to call count(game)


capitalist atheist
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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