So, I have a for loop that is suppose to get a list of all the players in the game using GetPlayers(), as shown here:
local PlayerList = {}
do
for _,player in pairs(game.Players:GetPlayers()) do
if player:IsA("Player") then
PlayerList[player] = true
end
end
PlayerAmount = (#PlayerList)
end
However something wasn't working later in the code when I needed PlayerAmount, so for debugging I added this:
print(PlayerAmount)
And it prints 0. Anyone have any idea whats wrong? Any help is appreciated, thanks! :)
And no, it's not disabled. :)
