The relevant law is
Sec. 229 of the Local Government Code:
Sec. 229.001. FIREARMS; AIR GUNS; EXPLOSIVES. (a) Notwithstanding any other law, including Section 43.002 of this code and Chapter 251, Agriculture Code, a municipality may not adopt regulations relating to:
(1) the transfer, private ownership, keeping, transportation, licensing, or registration of firearms, air guns, ammunition, or firearm or air gun supplies; or
(2) the discharge of a firearm or air gun at a sport shooting range.
(b) Subsection (a) does not affect the authority a municipality has under another law to:
(1) require residents or public employees to be armed for personal or national defense, law enforcement, or another lawful purpose;
(2) regulate the discharge of firearms or air guns within the limits of the municipality, other than at a sport shooting range;
(3) regulate the use of property, the location of a business, or uses at a business under the municipality's fire code, zoning ordinance, or land-use regulations as long as the code, ordinance, or regulations are not used to circumvent the intent of Subsection (a) or Subdivision (5) of this subsection;
(4) regulate the use of firearms or air guns in the case of an insurrection, riot, or natural disaster if the municipality finds the regulations necessary to protect public health and safety;
(5) regulate the storage or transportation of explosives to protect public health and safety, except that 25 pounds or less of black powder for each private residence and 50 pounds or less of black powder for each retail dealer are not subject to regulation;
(6) regulate the carrying of a firearm or air gun by a person other than a person licensed to carry a concealed handgun under Subchapter H, Chapter 411, Government Code, at a:
(A) public park;
(B) public meeting of a municipality, county, or other governmental body;
(C) political rally, parade, or official political meeting; or
(D) nonfirearms-related school, college, or professional athletic event;
(7) regulate the hours of operation of a sport shooting range, except that the hours of operation may not be more limited than the least limited hours of operation of any other business in the municipality other than a business permitted or licensed to sell or serve alcoholic beverages for on-premises consumption; or
(8) regulate the carrying of an air gun by a minor on:
(A) public property; or
(B) private property without consent of the property owner.
(c) The exception provided by Subsection (b)(6) does not apply if the firearm or air gun is in or is carried to or from an area designated for use in a lawful hunting, fishing, or other sporting event and the firearm or air gun is of the type commonly used in the activity.
(d) The exception provided by Subsection (b)(4) does not authorize the seizure or confiscation of any firearm, air gun, or ammunition from an individual who is lawfully carrying or possessing the firearm, air gun, or ammunition.
(e) In this section:
(1) "Air gun" means any gun that discharges a pellet, BB, or paintball by means of compressed air, gas propellant, or a spring.
(2) "Sport shooting range" has the meaning assigned by Section 250.001.
(f) The attorney general may bring an action in the name of the state to obtain a temporary or permanent injunction against a municipality adopting a regulation in violation of this section.
Sec. 229.002. REGULATION OF DISCHARGE OF WEAPON. A municipality may not apply a regulation relating to the discharge of firearms or other weapons in the extraterritorial jurisdiction of the municipality or in an area annexed by the municipality after September 1, 1981, if the firearm or other weapon is:
(1) a shotgun, air rifle or pistol, BB gun, or bow and arrow discharged:
(A) on a tract of land of 10 acres or more and more than 150 feet from a residence or occupied building located on another property; and
(B) in a manner not reasonably expected to cause a projectile to cross the boundary of the tract; or
(2) a center fire or rim fire rifle or pistol of any caliber discharged:
(A) on a tract of land of 50 acres or more and more than 300 feet from a residence or occupied building located on another property; and
(B) in a manner not reasonably expected to cause a projectile to cross the boundary of the tract.
Sec. 229.003. REGULATION OF DISCHARGE OF WEAPON BY CERTAIN MUNICIPALITIES. (a) This section applies only to a municipality located wholly or partly in a county:
(1) with a population of 750,000 or more;
(2) in which all or part of a municipality with a population of one million or more is located; and
(3) that is located adjacent to a county with a population of two million or more.
(b) Notwithstanding Section 229.002, a municipality may not apply a regulation relating to the discharge of firearms or other weapons in the extraterritorial jurisdiction of the municipality or in an area annexed by the municipality after September 1, 1981, if the firearm or other weapon is:
(1) a shotgun, air rifle or pistol, BB gun, or bow and arrow discharged:
(A) on a tract of land of 10 acres or more and:
(i) more than 1,000 feet from:
(a) the property line of a public tract of land, generally accessible by the public, that is routinely used for organized sporting or recreational activities or that has permanent recreational facilities or equipment; and
(b) the property line of a school, hospital, or commercial day-care facility;
(ii) more than 600 feet from:
(a) the property line of a residential subdivision; and
(b) the property line of a multifamily residential complex; and
(iii) more than 150 feet from a residence or occupied building located on another property; and
(B) in a manner not reasonably expected to cause a projectile to cross the boundary of the tract;
(2) a center fire or rim fire rifle or pistol of any caliber discharged:
(A) on a tract of land of 50 acres or more and:
(i) more than 1,000 feet from:
(a) the property line of a public tract of land, generally accessible by the public, that is routinely used for organized sporting or recreational activities or that has permanent recreational facilities or equipment; and
(b) the property line of a school, hospital, or commercial day-care facility;
(ii) more than 600 feet from:
(a) the property line of a residential subdivision; and
(b) the property line of a multifamily residential complex; and
(iii) more than 300 feet from a residence or occupied building located on another property; and
(B) in a manner not reasonably expected to cause a projectile to cross the boundary of the tract; or
(3) discharged at a sport shooting range, as defined by Section 250.001, in a manner not reasonably expected to cause a projectile to cross the boundary of a tract of land.
Sec. 229.004. REGULATION OF DISCHARGE OF WEAPON BY CERTAIN MUNICIPALITIES. (a) This section applies only to a municipality located in a county in which the majority of the population of two or more municipalities with a population of 300,000 or more are located.
(b) Notwithstanding Section 229.002, a municipality may not apply a regulation relating to the discharge of firearms or other weapons in the extraterritorial jurisdiction of the municipality or in an area annexed by the municipality on or before September 1, 1981, if the firearm or other weapon is:
(1) a shotgun, air rifle or pistol, BB gun, or bow and arrow discharged:
(A) on a tract of land of 100 acres or more and more than 150 feet from a residence or occupied building located on another property; and
(B) in a manner not reasonably expected to cause a projectile to cross the boundary of the tract; or
(2) a center fire or rim fire rifle or pistol of any caliber discharged:
(A) on a tract of land of 100 acres or more and more than 300 feet from a residence or occupied building located on another property; and
(B) in a manner not reasonably expected to cause a projectile to cross the boundary of the tract.