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
 

Re: HELP ME FIX THIS PLEASE

Previous Thread :: Next Thread 
ntmcd is not online. ntmcd
Joined: 07 Oct 2011
Total Posts: 2432
18 Apr 2014 09:21 AM
This script should print the number of tools named 'Tool' in workspace every 3 seconds. It prints the correct number the first time and 0 every time after.
x=1
function GetAllChildren(Parent, lol)
for _, Child in pairs(Parent:GetChildren()) do
if Child.Name == 'SAXXXTON' then
lol[x] = Child
x = x+1
end
GetAllChildren(Child, lol)
end
return #lol
end
val = {}
val1 = {}
while true do
a = GetAllChildren(game.Workspace, {})
b = GetAllChildren(game.Players, {})
print(a+b)
wait(3)
end
Report Abuse
ntmcd is not online. ntmcd
Joined: 07 Oct 2011
Total Posts: 2432
18 Apr 2014 09:27 AM
Anyone
Report Abuse
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
18 Apr 2014 09:29 AM
while true do

tools = 0
number = Workspace:GetChildren()

for i = 1, #children then

if number[i].Name == "Tool" then
tools = tools + 1
end

end

print(tools)
wait(3)
end
Report Abuse
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
18 Apr 2014 09:29 AM
while true do

tools = 0
number = Workspace:GetChildren()

for i = 1, #number then

if number[i].Name == "Tool" then
tools = tools + 1
end

end

print(tools)
wait(3)
end
Report Abuse
manuelferras is not online. manuelferras
Joined: 05 Jun 2010
Total Posts: 75
18 Apr 2014 09:30 AM
the 2nd one
Report Abuse
ntmcd is not online. ntmcd
Joined: 07 Oct 2011
Total Posts: 2432
18 Apr 2014 09:53 AM
i need the function to be recursive
Report Abuse
ntmcd is not online. ntmcd
Joined: 07 Oct 2011
Total Posts: 2432
18 Apr 2014 10:06 AM
bump
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