Long guns can be purchased out of state. Handguns must be purchased in state only.
Point of clarification: You can buy a handgun out of state...just not cash and carry. It would have to be shipped from where you buy it to a FFL in your home state...where you will pick it up.