items = {} function onTick() bf:findAllObjects (items, objType) if(#items ~= nil) then for index, value in pairs(items) do local roll = math.random(teamCount) value:setTeam(roll) end end end function main() game = bf:getGameInfo() teamCount = game:getTeamCount() subscribe(Event.Tick) end