Thanks, Superku! Studying and tweaking your code helped me solve my problem. On creation, I set skill51 = NoOfMolecules for each molecule. Afterwards, this code did the trick.
Code:
function RemoveMolecules()
{
	NoOfMolecules = NoOfMolecules - 1;
	NoOfMolecules = clamp(NoOfMolecules, 2, 31);
	you = ent_next(NULL);
	while(you)
	{
		ENTITY* PointAndKill = you;
		you = ent_next(you);
		if(PointAndKill.skill51 > NoOfMolecules || PointAndKill.skill51 == NoOfMolecules)
		{								
			ptr_remove(PointAndKill);
		}
		wait(1);		
	}
}



Thank you! So how do I paste code the way you've been doing, instead of pasting as text? For your amusement, "Point and Kill" is a Nigerian slang used to refer to the way catfish is bought. You look at a bowl filled with live catfish (and almost no water) and point at the specific ones you want to buy. They are slaughtered and packed up for you on the spot laugh Not that I've ever bought them personally, but its catchier for me than "ENTITY* you2"

Last edited by rayp; 04/12/14 00:19. Reason: added code tags