Other countries have different cultures, populations, etc. The above is how every school shooting has ended. So if we stop the guy in the same manner before he gets inside the school, he won't kill children. At least I offer a solution (which is a damn good and effective one).
Here is an example. Ben Shapiro used to go and send his kids to a Jewish school. Long story short, it is very guarded (especially against bombs) and has multiple exists but only one entry. No one gets by those guards, and multiple guards within every doorway of that school. You know why? Because the shooters hate Jews, but not enough to commit suicide.