In NJ you need a permit to buy a pellet gun. Years ago, I was a company rep for testing equipment from 3 overseas companies. So that meant I spent a good bit of that Summer in NJ. I got bored and went to gun shop. There I found a pellet gun that I thought I could use during the evening and weekends when I didn't go home. They asked me for my permit and I told them I was from Maryland and working here for the Summer.
They told me they could have me arrested for trying to purchase while being an out of state resident. They were cool and knew I was ignorant of the law, so they just told me to forget about it.
This was 16-20 years ago.