There exists no global legislative body that can even pass such a law much less enforce it. Even if such a law could be passed, destroying all the existing armed robots would be very difficult.