The high school students were planning an attack with pipe bombs and guns, police say.