In my beautiful 3rd world country (yeah we remained non-aligned during the cold war), Tigers and Leopards have a tendency to come near human settlements and attack domesticated animals.
Over here, killing animals (apart from chicken, fish, duck etc, which people regularly eat) is illegal. That means your can't kill snakes, deers, wild pigs, crocodiles and you certainly cannot kill Tiger, Leopards etc (because they're kind of endangered...).
If you do and they find out, you're going to jail. It doesn't matter whether the aforementioned wild animals killed your animals or humans.
So what do you do if presence of wild animals have been detected? You tell the authorities; they'll set traps, capture the animal, and release it to the forests.
By the way, recently, there was an appeal to the government to declare wild boar as pests, so that it can be killed because wild boars destroy crops and stuff. Government declined, because if the boars are killed, the big cats would starve.
This might all seem strange, but over here tiger/lion/leopard population was dwindling in the last century. But their population is now at a healthy level.
-----
About the gun situation here: nobody really has guns. Except very few maybe. There's plenty of crimes, but those don't involve a gun. Guns definitely would not be a solution to minimize the crime situation here.