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

How can I access every Players Stats?

I tried this, but it didn't work. I have no idea what to do to access the players stats.

wait(10)

Players = game.Players:GetPlayers()

for i,v in pairs(Players)
do
	i:GetChildren()
	print(i[1])
end

Thanks in advance.

1 comment

0

print(i:GetChildren()[1])

1 answer

✓ Accepted answer

You are using index, not value. Index is represented by the i. This is just the number of the position of the member in the array. Value is what you are looking for. Value is the actual member of the array that the loop is passing through. In this case, this a player. Another error that can be seen is that you are getting the first member of the index, which doesn't make sense. You should be obtaining it from the table. Here is what our script should look like:

wait(10)

Players = game.Players:GetPlayers()

for i,v in pairs(Players)
do
    local children = v:GetChildren()
    print(children[1])
end

Hope this helps!!

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