This paper studies the collective behavior of multi-agent systems with communication delays under the influence of environment. Leaders in the system are able to extract information from the environment, while followers are not. We extend the attraction and repulsion functions to a class of functions with certain properties, and use matrix, graph theory, Lyapunov stability test and other methods to carry out the work. Under the general assumption, we prove that the individuals of the multi-agent system will form a population to gather together and enter a bounded region. In addition, the effect of time delay on the system can be seen through numerical simulation.