(WWLP) – Money from a massive settlement with opioid manufacturers and distributors will soon hit municipal accounts.

Cities and towns in Massachusetts will split more than $210,000,000 while the state will get another $310,000,000. That money will be used for things like overdose prevention and addiction treatment.

Attorney General Maura Healey settled a lawsuit with four different opioid manufacturers and as a result Massachusetts will receive upwards of $500 million.

One area of the rollout that lawmakers take issue with is the amount that each community will receive. For example, Boston is on track to receive more than $22 million over a 16 year period while communities in the Berkshires will get about $1,500 over that same time frame.

“The size of the community isn’t always what matters when it comes to the funding given to support the damage created by the opioid crisis,” said Pittsfield Senator Adam Hinds.

Over the last 20 years, more than 22,000 Bay Staters have died from opioid-related overdoses. This money will help the state combat the opioid crisis and connect residents to the services they need.