Officials say the teenager had warned friends after lunch that he was “going to do something” and told them to go home, but they thought he was joking.