DETROIT (AP) — A Detroit man has been sentenced to three years of probation for accidentally shooting and killing a friend while they were streaming live on Instagram.

Dawone Cook was sentenced Wednesday. In addition to the probation, he must complete 100 hours of community service, which includes speaking to schoolchildren about the dangers of playing with guns and gun violence.

READ MORE: CDC: New Listeria Outbreak Tied To 23 Illnesses, 1 Death

Cook accidentally shot his friend Dylan Hemphill in the head on April 2 as they were showing off weapons and money on Instagram.

READ MORE: Red Wings Hire Lightning Assistant Derek Lalonde As Coach

Wayne County Circuit Court Judge Gregory Bill told Cook at the sentencing hearing that he will have to live with the death for the rest of life and that Cook should remember Hemphill each time he speaks with students.

Cook pleaded guilty in June to the careless discharge of a firearm causing death.

MORE NEWS: Troubling Arsenic Levels Found At Some Detroit Demolition Sites

© 2018 Associated Press. All Rights Reserved. This material may not be published, broadcast, rewritten, or redistributed.