Revelted
|
  |
| Joined: 02 Nov 2014 |
| Total Posts: 503 |
|
|
| 09 Sep 2017 04:56 PM |
Because
print(#game.Players:Getchildren()) doesnt work
i dont know any other way lol can someone help me out?
Idk if I should use For i,v in pairs or what. |
|
|
| Report Abuse |
|
|
22618709
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 19221 |
|
|
| 09 Sep 2017 04:59 PM |
GetChildren() not Getchildren()
|
|
|
| Report Abuse |
|
|
|
| 09 Sep 2017 05:03 PM |
^ Wow what a hero.
local num = 0 function recurse(p) for _,v in next,p:GetChildren() do num = num + 1 recurse(v) end end recurse(workspace) print(num) |
|
|
| Report Abuse |
|
|
LaeMVP
|
  |
| Joined: 24 Jun 2013 |
| Total Posts: 4416 |
|
|
| 09 Sep 2017 05:04 PM |
| *blows everyone's mind with...* GetDescendants |
|
|
| Report Abuse |
|
|
|
| 09 Sep 2017 05:08 PM |
local Count = 0 function Search(Obj) for i,v in pairs(Obj:GetChildren()) do Count = Count + 1 Search(v) end end
Search(game.Workspace) print("Instances inside game.Workspace: "..Count) |
|
|
| Report Abuse |
|
|
22618709
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 19221 |
|
|
| 09 Sep 2017 05:10 PM |
he wrote "print(#game.Players:Getchildren())" so i assume he wants to just get the ammount of children in Players, nothing else
|
|
|
| Report Abuse |
|
|