for _,players in pairs(game.Players:GetPlayers()) for i = 1, #players do print(""..player.Name..""..i.."") end end
I want this to get all the players names and then print them so it would look like this: NinjoOnline 1 rarchet 2 daaabosss 3 So that way it gets each players name and gives them a select number after that, so I can do lists, etc. Anyone know whats wrong. Their is nothing in the output, so I don't know what the problem is.
NinjoOnline
On line 1, "players" is the player item itself. So, line 2 with "for i = 1, #players do" will not work. Here's the fixed version:
for i, player in pairs(game.Players:GetChildren()) do print(player.Name.." "..i) --the quotes in there are for a space, you can remove them if you want end
num = 0 for _,players in ipairs(game.Players:GetPlayers()) num = num + 1 print(player.Name.." "..num = 0) end