Put simply - America has a radicalization vector x mental health x access to rapid-fire guns problem. Take away the rapid-fire component (semi- or fully-automatic weapons) and that would significantly reduce the mass-shootings problem.
As far as the radicalization vector goes, the abolishing of Section 230 protections would be a good start (and I am grossly oversimplifying this).
I have no solutions for the mental health component; there are way too many factors to discuss here, related to insularity, economics, education and outcomes.
Those who break the law regularly have the means & connections to buy a gun illegally.
I very much doubt distressed teenagers will have the money & connections to buy a gun illegally especially on short notice.
Definitely won't stop all crime (just like it doesn't even in countries where guns are illegal) nor resourceful, determined attackers, but would definitely cut down on crazy teenagers doing mass shootings.