Pain medication

Anyone have to be on pain medication like Percocet, ect for a painful condition during pregnancy and everything be alright??