Well, in some cases they banned carry within town limits.
And that was the first manifestation of the difference between the urban and rural environments. It was taken as a plain truth back then that everyone had the right to carry a gun when out on the trail, as there were so many potential hazards. However, it might not be a good idea to have a saloon full of drunken brawlers with guns when they came into town for some R&R. Hence, the Sheriff might keep everyone’s guns in his office while they had a good time.