The self-enrichment of massive star clusters by p-processed elements is shown to increase significantly with increasing gas density as a result of enhanced star formation rates and stellar scatterings compared to the lifetime of a massive star. Considering the type of cloud core where a globular cluster (GC) might have formed, we follow the evolution and enrichment of the gas and the time dependence of stellar mass. A key assumption is that interactions between massive stars are important at high density, including interactions between massive stars and massive-star binaries that can shred stellar envelopes. Massive-star interactions should also scatter low-mass stars out of the cluster. Reasonable agreement with the observations is obtained for a cloud-core mass of ∼4 × 106 M⊙ and a density of ∼2 × 106 cm-3. The results depend primarily on a few dimensionless parameters, including, most importantly, the ratio of the gas consumption time to the lifetime of a massive star, which has to be low, ∼10%, and the efficiency of scattering low-mass stars per unit dynamical time, which has to be relatively large, such as a few percent. Also for these conditions, the velocity dispersions of embedded GCs should be comparable to the high gas dispersions of galaxies at that time, so that stellar ejection by multistar interactions could cause low-mass stars to leave a dwarf galaxy host altogether. This could solve the problem of missing first-generation stars in the halos of Fornax and WLM.