Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

Real quick simple question. How do you get the number of children?

I am trying to get the number of children of a part or something but I dont remember where do put the #

for i,v in pairs(game.Players:GetChildren()) do
	print(v)
end

Theres the for loop but I forgot where you put the # to make it a number value..

Anyone know?

1 comment

0

#Instance:GetChildren()

1 answer

✓ Accepted answer
local Player = game.Players:GetChildren()
local PlayerChildren = #Player
print (PlayerChildren)

4 comments

0

Yea that's the worst way to get players

0

doesn't matter which way... if it works it's good lol

0

It does matter. I could do tons of things i.e. game:GetService("Players").Name = "asd" or Instance.new("Part", game:GetService("Players"))

0

@Kiriot22. I simply answered his question on how to reference the "#". Now of course the code might not be efficient, but that was not his original question. Ironically, you also put a worst way to instance an object in a game.

This discussion is preserved as it was. New answers, comments, and votes are closed.