Certified GKH Gardening Expert
By boring animals, do you mean worms/caterpillars or those of the four legged kind like mice or squirrels? For worms/caterpillars, you can try using Bt (https://www.gardeningknowhow.com/plant-problems/pests/pesticides/using-bacillus-thuringiensis.htm) while the following articles should help control rodent pests: https://www.gardeningknowhow.com/plant-problems/pests/animals/garden-mouse-control.htm
https://www.gardeningknowhow.com/plant-problems/pests/animals/get-rid-squirrels.htm
As for eating them, if the melons aren't too badly damaged or rotted, then it's quite safe to eat (washing thoroughly of course). Just cut out any yucky or questionable parts.
It is probably still edible , just cut away the damaged part of fruit when you first notice it and it should be fine. When you say animals, you mean bugs right? if you did me animals, just kill the animals and lay traps or poison. if you mean bugs, there are a number of ways to eliminate bugs, You could spray bug killer, lay poison, traps, other bugs. If it is a flying moth or a cricket, beetle,grasshopper, or insects like that, you could find some spiders in some woods and release them around your garden. It would slowly decrease the number of bugs without causing harm to the plants, whereas the poison and bug killer may affect the plant and kill it.