Here is my script
local players = game.Players:GetPlayers()
local timeleft = Workspace:findFirstChild('time')
local currentMap = game.Workspace.currentMap
local _Teams = game:GetService'Teams'
local _Players = game:GetService'Players'
function removeTime()
for i = 120, 0, -1 do
wait(1)
timeleft.Value = i
end
end
function gameStart()
local players = game.Players:GetPlayers()
for i = 1, #players do
local stats = players[i].PlayerGui.fullGui.everything.gamePlay.informer
stats.Text = 'New round beginning!'
stats.FontSize = 'Size24'
timeleft.Value = 120
wait(1)
stats.Text = ''
end
end
function splitplayers()
game.Teams.Lobby:remove()
local Teams = _Teams:GetTeams()
local function GetPlayers()
return _Players:GetPlayers()
end
_Players.TeamColor = Teams[#GetPlayers()%#Teams].TeamColor
end
function pickteams()
local Cops = Instance.new("Team", game.Teams)
Cops.TeamColor = BrickColor.new("Bright blue") -- Note that TeamColor is a BrickColor value
Cops.Name = "Cops"
local Crimanals = Instance.new("Team", game.Teams)
Crimanals.TeamColor = BrickColor.new("Bright orange")
Crimanals.Name = "Crimanals"
end
function teleportPlayers()
local players = game.Players:GetPlayers()
local copspawn = Workspace.currentMap.CopBase.teleportationpart
if players.TeamColor == BrickColor("Bright blue") then
players.Character.Torso.CFrame = CFrame.new(copspawn.Position)
end
local robberspawn = Workspace.currentMap.RobberBase.teleportationpart2
if players.TeamColor == BrickColor("Bright orange") then
players.Character.Torso.CFrame = CFrame.new(robberspawn.Position)
end
end
function waitSome()
local players = game.Players:GetPlayers()
for i = 1, #players do
local stats = players[i].PlayerGui.fullGui.everything.gamePlay.informer
stats.FontSize = 'Size24'
stats.Text = "Let's take a quick break. Use this time to buy stuff in the shop!"
wait(30)
stats.Text = ''
end
end
function endGame()
game.ReplicatedStorage.Lobby:Clone().Parent = game.Teams
local players = game.Players:GetPlayers()
for i = 1, #players do
players[i]:LoadCharacter()
end
end
currentMap:ClearAllChildren()
function goAhead()
local players = game.Players:GetPlayers()
for i = 1, #players do
players[i].PlayerGui.fullGui.everything.gamePlay.informer.Text = 'We have enough players to start!'
end
end
wait(5)
function chooseMap()
local maps = game.ServerStorage.Maps
local clone = maps[math.random(1,#maps)]
clone.Parent = currentMap
end
while wait() do
if game.Players.NumPlayers >= 2 then
goAhead()
splitplayers()
pickteams()
chooseMap()
gameStart()
teleportPlayers()
removeTime()
endGame()
waitSome()
else
local players = game.Players:GetPlayers()
for i = 1, #players do
players[i].PlayerGui.fullGui.everything.gamePlay.informer.Text = '2 players are needed to start! Invite a friend.'
end
end
end
The script so far works up until the gui text says "we have enough players" after that it is supposed to create teams and split the players into them and teleport them. HELP PLEASE! I dont know why this is happening i thought i tried everything.

2 comments
Do I replace [NameofFirstTeam] with the name of the first team in "" like this ["Cops"] or just "Cops" and after that it says TeamColor do i leave that or replace it with that teams color example "Bright blue" or just Bright blue
I updated the answer to add some more clarity; you should leave TeamColor as it is.