What they've done in Texas and PA is the answer! We have enough cops and Military men and women to protect every school in this nation or any public place without it becoming a police state!
Just like they are doing now they have a cop at every school why can it not continue? The biggest determent to these animals is failure and also seeing one or two killed trying to act will deter many also.
The problem is that's NOT the answer. Having KNOWN force that can respond to threats will NOT help. Having an UNKNOWN force that can react to the threat is the answer. If someone is hell bent to kill, THEY WILL! and if they KNOW who can react, they will take out those people first. Action is faster than reaction.
Case in point: several years ago there was a shooting in Kirkwood City hall, which is about a half hour from me. The perp, Charles Lee "Cookie" Thornton, approached Sgt William Biggs in the parking lot across the street from town hall AND the police station. The report I receive indicated Cookie asked Sgt Biggs for the time, at which point he brought a 44Mag revolver up to the base of Sgt Biggs skull and executed him. He then took Sgt Biggs' weapon and proceeded into city hall. Upon entering the council chamber, he immediately executed the officer on duty, before anyone could react. This eliminated the immediate likelihood of him being stopped. He then proceeded to go down the dias, firing at the council members one by one. By the time police were able to arrive and take him down, several council members and other city officials were dead or wounded. The sad thing is while the city hall is 'off limits' to concealed weapons, the council members DO have a legal right to be carrying at the meetings. Had one or more of them been exercising that right, it is very likely less people would have been killed.
As evidenced in this case (And many more, I'm sure), the known armed threat to the perp was immediately eliminated, thus freeing the perp to continue his rampage unmolested much longer than he could have if there were unknown individuals in the room that could have responded.
The bottom line is if you have one or two police or security guards 'standing guard', a perp WILL have the drop on them and WILL execute them first, above all, and then continue murdering.