players = {game.Players:GetChildren()}
for i,v in ipairs(players)do
print(players[v])
end
Output: It prints "nil"
I'm not sure what I'm doing wrong, I just read about them in the wiki so if someone could help me I would appreciate it
players = {game.Players:GetChildren()}
for i,v in ipairs(players)do
print(players[v])
end
Output: It prints "nil"
I'm not sure what I'm doing wrong, I just read about them in the wiki so if someone could help me I would appreciate it
for i,v in ipairs(game.Players:GetChildren()) do
print(v)
end
Okay I'm not exactly sure how to explain.. and I'm pretty sure this is not the way it should be explained, but when getting the children, you don't need to make an actual table for that.
Thanks :)
This discussion is preserved as it was. New answers, comments, and votes are closed.
2 comments
Try using "pairs" instead of "ipairs" - "ipairs" is only really for tables indexed by numerical keys.
Thanks :)