PichotM Has an amazing post, check it out!

function GetPlayers()
    local players = {}
    for i = 0, 256 do
        if NetworkIsPlayerActive(i) then
            players[#players + 1] = i
        end
    end
    return players
end

Run that client side then create a Server event that parses that info, if you need it serverside.
Else just have this in your clientside file. :slight_smile:

Hope this helps!