You must assume the active shooter is better armed, better armored, so get out the area as fast as possible and wait for LEO with big enough weapons to take down the shooter.
Nothing wrong with trying to get out, if you can, but know that waiting for the LEOs to respond can take anywhere from 0 minutes to 20 or 30 minutes, and those are just the first responders, not necessarily the LEOs with big enough weapons to take down the shooter. Most active shootings end in under 5 minutes. So sometimes, the cops never get there while the shooter is active. That is just reality. Reliance on the cops to resolve the issue is most definitely a gamble in and of its own.
The Vegas concert shooting had the police being in the kill zone at the time the shooting started. Response by responding officers to stop the shooter was pretty good and they managed to shutdown the shooter in about 10 minutes, but that was 10 minutes the shooter continued to engage targets.
The Tyler Square and Sutherland Springs Church shootings lasted long enough for 3rd parties to respond, engage the shooter, and the shooter flee before LEOs with big enough guns could respond. Tyler Square involved cops already shooting it out with the suspect when Mark Wilson came down from his apartment to engage the shooter. Sutherland Springs lasted long enough for Stephen Willeford to grad a rifle from his gun safe, grab a magazine, and load it while proceeding on foot from his home to the church where he engaged and later gave vehicular pursuit to the shooter before cops ever arrived.
The Aurora theater shooting took cops several minutes to confront the shooter, approximately 7 minutes after the first 911 call, but the first 911 call didn't happen until after the shooter had already done quite a bit of his shooting. Basically, he was done and leaving when confronted by the cops.
It took cops roughly 5 minutes to respond to the King Soupers shooting in Colorodo. That was to arrive on scene. It was another 2 minutes before officers entered the store and a minute after that before the first engagement with the shooter who came out on top of that engagement, sadly killing one responding officer. With their noses effectively bloodied, officers reverted to the surround and contain strategy that had largely been abandoned more than 20 years after the Columbine fiasco. There an officer was on scene at the time of that shooting, did briefly engaged one shooter, but waited outside (as was doctrine of the day) for other officers to arrive and surround the school, to contain the situation, all the while the shooters were killing people inside. Fortunately, at King Soupers, the shooter did not continue to search for, and kill shoppers hiding in the store while the cops waited outside.
Cops were on scene virtually from the start of the North Hollywood bank robbery that lasted some 44 minutes. A prolonged gunbattle ensued before LAPD got SWAT cops on scene and could get their act together enough to allow any of the SWAT officers into the battle, despite some having arrived piecemeal with rifles (one famously seen in PT shorts and vest, helmet, rifle) well before they actually engaged with rifles. Civilians were wounded after police had arrived on scene. Tactics have changed since then and more officers are armed with patrol rifles, but bumbling police response is still a reality. Call it fog of war, inexperience, doctrine, training, command paralysis, or whatever, but just because the police show up doesn't mean you are safe. Folks often don't like to admit it, but cops are just people, sometimes highly trained, but are still just people.
For example, the Parkland (FL) school shooting had an officer on scene at the time of the shooting who failed to engage and actually hampered other officers from engaging. The shooter escaped several minutes after the shooting started while they bumbled around.
Officers were nearby for a workplace shooting in Manhattan and who engaged the suspect on the street while fleeing the shooting. The cops killed the suspect, but the cops managed to wound 9 bystanders in the process. Numerically, the cops in their attempt to stop the workplace (but not mass) shooter, became mass shooters, themselves. Fortunately, most people injured by the cops were just fragged by ricochets.
A lot can happen before and after the cops arrive. We each have our own issues with which to contend on deciding whether to actively engage a shooter or flee. Some may only engage the shooter as a last resort. What is the best decision at the time of the event from your perspective inside of the event certainly may not be perceived in the same manner by those who examine it after the event. You have to do what you think is right and deal with the consequences accordingly. These situations are inherently fluid and dangerous.