Good afternoon, everyone reading! Could you help me to print the names of all the players in my game at one time? Here are my past attempts.
for i, player in pairs(Players:GetPlayers()) do
print(player.Name)
end
Good afternoon, everyone reading! Could you help me to print the names of all the players in my game at one time? Here are my past attempts.
for i, player in pairs(Players:GetPlayers()) do
print(player.Name)
end
What exactly is the issue in this? I certainly know that script works.
Honestly, I still do not really understand what the problem is, there seem to be no errors, but in the console there is just an empty field, instead of the player’s name.
Are Players
the actual Players service? Just to make sure after all
You could also add a wait(10) before you go through the loop of all players
That might have been executed before all players even connected. Consider this:
game:GetService("Players").PlayerAdded:Connect(function(player)
print(player.Name)
end
Thank you you were rightThank you, that was really the problem, you’re right