---- This script is most useful for when you're trying to assign teams to people based on their rank within your group, such as a team for the owner, admins, etc.


game.Players.PlayerAdded:connect(function(newPlayer)
	local rank = newPlayer:GetRankInGroup(16072157) ---- Change that number to the ID of your group
    local teamName = ""
	if rank == 253 then ---- Change this number to that of the desired rank, find it on the admin page
        teamName = "Owners" ---- Change this to the name of the team you want this person on
	elseif rank >= 252 and rank ~= 8 then
		teamName = "Hostiles"
	elseif rank == 250 then ---- Change this number to that of the desired rank, find it on the admin page
		teamName = "High Command" ---- Change this to the name of the team you want this person on
    elseif rank >= 1 and rank ~= 5 then ---- This one accounts for all members not in the previous ranks, but excludes the prison rank, adjust for your purposes
		teamName = "Visitor"
	elseif rank == 0 then ---- Change this number to that of the desired rank, find it on the admin page
        teamName = "Guest" ---- Change this to the name of the team you want this person on

    end
    newPlayer.TeamColor = game.Teams[teamName].TeamColor
end)
