It's supposed to clone the children of Officer into the players that are cops. Help would be appreciated
local Hunters = {}
local Cops = {}
local Officer = game.Workspace.Characters.Officer:GetChildren()
local Players = game.Players:GetChildren()
for i,v in pairs(Players) do
table.insert(Hunters,v)
end
function chooseRandomPlayer(fromTeam,toTeam)
local randomPlayer = nil
repeat
randomPlayer = fromTeam[math.random(1,#fromTeam)]
until randomPlayer
table.insert(toTeam,randomPlayer)
for i,v in pairs(Players) do
if v.Name == randomPlayer.Name then
for z,b in pairs(Players) do
if (b.className == "Hat") or (b.className == "CharacterMesh") or (b.className == "Shirt") or (b.className == "Pants") or (b.className == "ShirtGraphic") then
b:Remove()
end
if Cops then
Officer.Parent = Cops
end
end
table.remove(fromTeam,i)
end
end
end
chooseRandomPlayer(Hunters, Cops)

2 comments
Please explain what you want the code to do. At a glance, it's not really possible to determine what you expect is supposed to happen.
there edited it to explain better.