local Teams = game:GetService("Teams")
local function GetPlayerTeam(player)
local blueTeam = Teams:FindFirstChild("Blue")
local redTeam = Teams:FindFirstChild("Red")
local function updateTeamCounts()
local blueTeamPlayerCount = #blueTeam:GetPlayers()
local redTeamPlayerCount = #redTeam:GetPlayers()
end
local function team()
local blueTeamPlayerCount = #blueTeam:GetPlayers()
local redTeamPlayerCount = #redTeam:GetPlayers()
if blueTeamPlayerCount == 0 then
player.Team = blueTeam
elseif redTeamPlayerCount == 0 then
player.Team = redTeam
end
updateTeamCounts()
end
return team
end
local getPlayerTeam = GetPlayerTeam(player)
getPlayerTeam()