Teen in court for bringing gun to school