How do I get only players in teams, and how do I get only teams with one or more players?

Title esentially says all, need this for a custom leaderboard.

Only players in teams? You can do a
for i,v in pairs(game.Players:GetPlayers()) do
if player.TeamColor == game.Teams.WhatEverTeamItIs.TeamColor then
print(“hi”)
end
end

and from this, you can just insert them into a table and say if #table > 1 then

Ok sorry but I forgot a more efficient way, you can do local teamVariable = game.Teams.WhatYourTeamIs:GetPlayers() then do #teamVariable to count how many are in it

Thanks, and how do I get only teams with 1 or more players?

Like I said in my last reply, when you do #teamVariable, it checks how many things are in the table, so if you just do
if #teamVariable >= 1 then
you can get what you want