How did they stop people from carrying guns like cowboys?

In the West, how did they ban carrying guns like the cowboys? It seems like it totally stopped in the 1900 to 1920 timeframe, more or less. Was there a law in every state that banned carrying guns? Or was in just a city to city decision?

Could you go from Tombstone to New York and still carry a gun or would that earn you jail time in New York?

In many states today, open carry (un concealed and uncased) is still legal. So I’d say in most cases it wasn’t done with state laws. In some states where open carry is not illegal at the state level, some citys have made it illegal at their level while it’s still legal in other parts of the state.

Depends on where you live.

In a more direct answer to your question, viewing the map at this site indicates that you could make it as far as Pennsylvania.

It would have earned you jail time in Tombstone. The gunfight at the OK corral started when the Earps attempted to enforce a city ordinance that banned carrying weapons in the city of Tombstone. Wild Bill Hickok was vigorous in enforcing a similar ban in Abilene, Kansas. Carrying weapons in “the Old West” was often a necessity to guard against bandits or Indian raid in open country, but in cities it wasn’t uncommon to have an ordinance that those weapons had to be checked in at the sheriff’s office when you came into town. Drunken cowboys shooting up the place was just bad for business.