Replacing toilet supply line and valve
the nut kept moving along with the fill valve.


Have a helper use your pliers to grab on to the fill valve inside of the tank; you need to prevent the fill valve from turning. Then remove the supply flex nut by unscrewing with a large adjustable wrench, an open-end wrench, or with your other pliers.

I would go ahead and change everything: stop valve, supply flex, and toilet fill valve.