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
On Line 3 you wrote "UseSeccondTeam" with two Cs instead of "UseSecondTeam" with one C. If you fix that the blue underline will not execute.