AutoTeam Problems, need help

So, what I want is:

If they are in a ‘division’, they will get teamed their division, and the script will ignore the call of if your in the main group, you will be teamed space force personnel.

BUT

If your not in the division and in the main group and not a basic training member, it will team you space force personnel.

AND

if your a basic training rank, you will be teamed basic training

This is what I have so far:

local Players = game:GetService("Players")
local autoteam = {
	[9336203] = BrickColor.new("Really red"),
	[9336129] = BrickColor.new("Hot pink"),
	[9336214] = BrickColor.new("Brown"),
	[9336191] = BrickColor.new("Neon orange"),
}

local function RankPlayer(Player)
	for GroupID, TeamColor in pairs(autoteam) do
		if Player:IsInGroup(GroupID) then
			Player.TeamColor = TeamColor
			break
		end
	end
end

Players.PlayerAdded:Connect(RankPlayer)
1 Like

If plr is in group(0000) --Enter group ID here
then
local Players = game:GetService(“Players”)
local autoteam = {
[9336203] = BrickColor.new(“Really red”),
[9336129] = BrickColor.new(“Hot pink”),
[9336214] = BrickColor.new(“Brown”),
[9336191] = BrickColor.new(“Neon orange”),
}

local function RankPlayer(Player)
for GroupID, TeamColor in pairs(autoteam) do
if Player:IsInGroup(GroupID) then
Player.TeamColor = TeamColor
break
end
end

Try this, if it doesn’t work, then I don’t know how else to fix it.