Hi, newbie question. I have this sample of code that I got from the developer website.
Players = game:GetService("Players")
for i, player in pairs(Players:GetPlayers()) do
print(player.Name)
end
This code works when I paste it in a local script but it doesn't when I paste it in a server side script. I don't get an error, but nothing gets printed. I am wondering why this is, and also what code do I need to use to get all players from a server side script. Thanks

2 comments
thanks for suggestion. I have tried this and also wait(2) just to see if it was that players weren't added yet, but it still doesn't work
"#game.Players:GetChildren() > 0" returns a boolean, which will the code to halt