var obj; while (obj=FindObject(0, 0,0,0,0, 0, 0,0, 0, obj)) if (GetCategory(obj) & C4D_Goal) RemoveObject(obj);