On the day of the incident, Elswick believed a friend of his was in trouble at the school, King said.
"He thought his friend was being held hostage and needed his help," King said. "It was something that was not true."
Elswick's sister, Marsha McGuire of Cross Lanes, said that if released he would live with his mother in Clendenin.
Webster said, "I'm concerned that the injuries affected his mental faculties," but added that the allegations he faces are serious.
If released, Webster ordered that Elswick must live with his mother in a home that has no firearms. She instructed family members to notify the court immediately if they have concerns about him.
"Out of an abundance of caution, I'm also going to order that he have continuing medical treatment and counseling," she said.
Contact writer Cheryl Caswell at cher...@dailymail.com or 304-348-4832.