Yeah, I've never been good with randomizing, but this is what I've got but it doesn't work?
local function SplitPlayers()
local players = {}
for _, player in pairs(game.Players:GetPlayers()) do
if player.TeamColor == BrickColor.new("Medium stone grey") then
table.insert(players, player)
end
end
local redTable = {}
local blueTable = {}
local redPlayers = math.floor(1/2 + #players * 4/6)
local bluePlayers = #players - redPlayers
for i = 1, redPlayers do
local player = table.remove(players, math.random(#players))
table.insert(redTable, player)
player.TeamColor = BrickColor.new("Really red")
end
for i = 1, bluePlayers do
local player = table.remove(players, math.random(#players))
table.insert(blueTable, player)
player.TeamColor = BrickColor.new("Bright blue")
end
end

4 comments
Please explain your answer. Simply code is not enough.
Wow downvote me for giving him the answer e.e
Yes it's an answer but this will not help him learn unless he understands what this does and how it works, and most likely wont as he didn't make it like this in the first place. Explain code, don't just post it and say "Here you go"
Yes, I agree with ChemicalHex and MrLegoman900, you need to explain your answer. Even I couldn't understand it at first. And make sure you format your code properly, it's a bit wonky.