Several US schools to install pepper-spraying drones to respond to school shootings
(www.theguardian.com)
I am not saying this isn't ridiculous but it is worth a try in an emergency.
The problem with pepper spray is it doesn't incapacitate the attacker directly, so if you are in the immediate vicinity of their body they can still hurt you.
If you are down the hall from the drone that is pepper spraying the attacker that is a much different situation because then they are going to have to navigate the environment to get to you while literally in blind rage/pain... and now you have a chance to get away/lock doors raise the alarm, knock shit down in their path or whatever.
Also I am not saying rely on it as the only option.