diff --git a/config/docs.cfg b/config/docs.cfg
index 1f4bf61c..84c9615c 100644
--- a/config/docs.cfg
+++ b/config/docs.cfg
@@ -335,6 +335,10 @@ docident [writecfg] [writes current configuration to config/saved.cfg - automati
docsection [Gameplay]
docident [add2alias] [This will append the passed 2nd argument to any existing content of the alias named in the 1st argument. Several popular aliases have predefined shortcuts using this scriptalias: addOnQuit, addOnLoadOnce, addOnLoadAlways. Check config/scripts.cfg for possible omissions in that list.];
docexample [foo = "one" add2alias foo two echo foo] [Output: one two];
+docident [addOnQuit] [Execute a command or block of code on quit.];
+docident [addListOnQuit] [Deletes a list of aliases (from saved.cfg) on quit.];
+docargument [L] [the list of aliases to delete] [] [0];
+docexample [addListOnQuit "a b c"] [Deletes aliases a, b, and c from existance and saved.cfg upon quit.];
docident [addbot] [add a bot for a given team with a given skill calling him a given name.];
docargument [T] [team] [RVSF or CLA or SPECTATOR] [0];
docargument [S] [skill] [best, good, medium, worse OR bad] [0];
diff --git a/config/on_quit.cfg b/config/on_quit.cfg
new file mode 100644
index 00000000..cab507e8
--- /dev/null
+++ b/config/on_quit.cfg
@@ -0,0 +1,25 @@
+// Adds a list of aliases to be deleted (cleared from saved.cfg) on every quit.
+// Do not modify. (unless you really know what you're doing)
+addListOnQuit = [ alias_list = $arg1; loop al (listlen $alias_list) [ addOnQuit (concat "delalias" (at $alias_list $al)) ] ]
+
+on_quit_aliases = [
+ cmapp
+ i
+ len
+ modifier
+ numcla
+ numrvsf
+ r
+ s
+ sbdesc
+ sbdns sbport
+ tmp_botmap
+ tmp_botskill
+ tmp_gamma_list
+ tmp_hex
+ tmp_mode
+ tmp_numbots
+ tmp_wc
+]
+
+addListOnQuit $on_quit_aliases
\ No newline at end of file
diff --git a/config/scripts.cfg b/config/scripts.cfg
index 1a07b69b..e0e89fdf 100644
--- a/config/scripts.cfg
+++ b/config/scripts.cfg
@@ -363,4 +363,6 @@ customclaimadminscript = [
run dyngamma
-run tutorial
\ No newline at end of file
+run tutorial
+
+run on_quit
\ No newline at end of file
diff --git a/docs/reference.xml b/docs/reference.xml
index e76c865f..bd4b431c 100644
--- a/docs/reference.xml
+++ b/docs/reference.xml
@@ -1378,6 +1378,27 @@ echo foo
+
+
+ Execute a command or block of code on quit.
+
+
+
+
+
+
+ Deletes a list of aliases (from saved.cfg) on quit.
+
+
+
+ Deletes aliases a, b, and c from existance and saved.cfg upon quit.
+
+
+
+
+
+
+
This will be executed each time the player dies.