local function splitplayers()
game.Teams.Lobby:Destroy()
local UseSeccondTeam = false
for i, v in ipairs(_Players:GetChildren()) do
if UseSecondTeam then
v.TeamColor =
_Teams["Cops"].TeamColor
else
v.TeamColor =
_Teams["Robbers"].TeamColor
end
UseSecondTeam = not UseSecondTeam
end
end
There is a blue underline under if** UseSecondTeam** then and it says UseSecondTeam is only used in the enclosing function consider changing it to local

1 comment
You misspelled UseSecondTeam on line 3. Also, please make your question title relevant to topic in the future instead of generic Help me or what am I doing wrong.