I've had great luck with mine not getting taken off, but I am making another coop ASAP.
take
@The Moonshiner 's advice. predators have to eat too, but they will sadly choose your hens over your rodent problem if you don't have those birds inside a secure place.
make a coop with roosts in it. when the chickens have roosted on the tree, but it's still light enough for you to clearly see your way without the help of a flashlight, use a handful of mealworms and throw it inside the coop. the hens will go inside and you can close the door behind them. after a few nights, the hens will understand that at a certain time, there will be mealworms. they will start going in the coop, waiting there for a bedtime snack. do 3-5 days of that when your hens do that. then start doing a 50/50 handful of mealworms and their regular food. do that for another 3-5 days. now do full hen feed handful for one week. the hens should still e going in the coop at night. here's the time when you start minimizing the handful of feed to 3/4. 3/4 for 5 days. 1/2 handful for 5 more days. 1/4 handful for 5 days. then you will have trained hens that go into the coop every night. sometimes, give them a treat before bed. you can also start giving them their food at night, instead of in the morning.
Sorry for such a long, boring post. that's just the way I got my hens to go into the coop.