I don't know why but I get no output from anything on this script to pick random local teams


local Players = game:GetService("Players")
local Workspace = game:GetService("Workspace")

local Infected = {}
local Survivors = {}

function pickPlayers()

    local PlayersGroup = Players:GetPlayers()
    
    local firstInfected = PlayersGroup[math.random(1, #PlayersGroup)]
    
    for i, v in pairs(PlayersGroup) do
        if i == firstInfected then
            table.insert(Infected, v.Name)
        else
            table.insert(Survivors, v.Name)
        end
    end
        

    
    print ("First Infected: "..firstInfected.Name)
    for i, v in pairs(Survivors) do
        print("Survivor"..v)
    end    
end

while wait(5) do
    pickPlayers()
end

can anyone help me figure out why this is giving me trouble?