diff --git a/extras/conf/udb/Includes/SRB222_linedefs.cfg b/extras/conf/udb/Includes/SRB222_linedefs.cfg
index ce1979581fb7e1251ad76882154eab80ec204f06..1b3343c9c52933db11df755905907f6876ab4795 100644
--- a/extras/conf/udb/Includes/SRB222_linedefs.cfg
+++ b/extras/conf/udb/Includes/SRB222_linedefs.cfg
@@ -125,6 +125,7 @@ udmf
 				{
 					1 = "Skip score tally";
 					2 = "Check emeralds";
+					4 = "Keep post level cutscene if score tally is skipped";					
 				}
 			}
 			arg2
diff --git a/src/doomstat.h b/src/doomstat.h
index 936d622610df83c4940d628b43c820880b68e7d0..a996941862d53b30e1cea4475a818e9db29a969d 100644
--- a/src/doomstat.h
+++ b/src/doomstat.h
@@ -249,7 +249,7 @@ extern textprompt_t *textprompts[MAX_PROMPTS];
 // For the Custom Exit linedef.
 extern INT16 nextmapoverride;
 extern UINT8 skipstats;
-extern UINT8 luakeepcutscenes;
+extern boolean keepcutscene;
 extern INT16 nextgametype;
 
 extern UINT32 ssspheres; //  Total # of spheres in a level
diff --git a/src/g_game.c b/src/g_game.c
index e3f1c41b09d1b6ee8c02fc19659d22e147fad41a..95f96ccf217c53a3fbcd22f195f6b2e29f5ab62c 100644
--- a/src/g_game.c
+++ b/src/g_game.c
@@ -160,9 +160,10 @@ textprompt_t *textprompts[MAX_PROMPTS];
 
 INT16 nextmapoverride;
 UINT8 skipstats;
-UINT8 luakeepcutscenes;
 INT16 nextgametype = -1;
 
+boolean keepcutscene;
+
 // Pointers to each CTF flag
 mobj_t *redflag;
 mobj_t *blueflag;
@@ -3160,7 +3161,7 @@ void G_DoReborn(INT32 playernum)
 					nextmapoverride = gamemap;
 					countdown2 = TICRATE;
 					skipstats = 2;
-					luakeepcutscenes = 0;
+					forcekeepcutscenes = 0;
 
 					for (i = 0; i < MAXPLAYERS; i++)
 					{
@@ -4211,7 +4212,7 @@ void G_AfterIntermission(void)
 
 	if ((gametyperules & GTR_CUTSCENES) && mapheaderinfo[gamemap-1]->cutscenenum
 		&& !modeattacking
-		&& (skipstats <= 1 || luakeepcutscenes > 0)
+		&& (skipstats <= 1 || keepcutscene == true)
 		&& (gamecomplete || !(marathonmode & MA_NOCUTSCENES))
 		&& stagefailed == false)
 	{
diff --git a/src/lua_baselib.c b/src/lua_baselib.c
index 6adf5b1599a8b5d06120702f229a134155111c75..211336c8cb310839209b81be88a230fff29c974b 100644
--- a/src/lua_baselib.c
+++ b/src/lua_baselib.c
@@ -4181,31 +4181,21 @@ static int lib_gSetCustomExitVars(lua_State *L)
 	nextmapoverride = 0;
 	skipstats = 0;
 	nextgametype = -1;
-	luakeepcutscenes = 0;
+	keepcutscene = false;
 
 	if (n >= 1)
 	{
 		nextmapoverride = (INT16)luaL_optinteger(L, 1, 0);
 		skipstats = (INT16)luaL_optinteger(L, 2, 0);
 		nextgametype = (INT16)luaL_optinteger(L, 3, -1);
-		luakeepcutscenes = (INT16)luaL_optinteger(L, 4, 0);
+		
+		if (!lua_isnil(L, 4))
+			keepcutscene = luaL_checkboolean(L, 4);
 	}
 
 	return 0;
 }
 
-// Another Lua function that doesn't actually exist, but since lib_gSetCustomExitVars exists...
-// The get counterpart would have been useful as well.
-// Gets nextmapoverride, skipstats and nextgametype for any other use
-static int lib_gGetCustomExitVars(lua_State* L)
-{
-	lua_pushinteger(L, nextmapoverride);
-	lua_pushinteger(L, skipstats);
-	lua_pushinteger(L, nextgametype);
-	lua_pushinteger(L, luakeepcutscenes);
-	return 4;
-}
-
 static int lib_gEnoughPlayersFinished(lua_State *L)
 {
 	INLEVEL
@@ -4647,7 +4637,6 @@ static luaL_Reg lib[] = {
 	{"G_FindMapByNameOrCode",lib_gFindMapByNameOrCode},
 	{"G_DoReborn",lib_gDoReborn},
 	{"G_SetCustomExitVars",lib_gSetCustomExitVars},
-	{"G_GetCustomExitVars", lib_gGetCustomExitVars},
 	{"G_EnoughPlayersFinished",lib_gEnoughPlayersFinished},
 	{"G_ExitLevel",lib_gExitLevel},
 	{"G_IsSpecialStage",lib_gIsSpecialStage},
diff --git a/src/lua_script.c b/src/lua_script.c
index 686555a16d6b09b98d839cefec0ac0fc876181ae..ff2ced1ecf3ee10477162f4def9fc4f47d3f753a 100644
--- a/src/lua_script.c
+++ b/src/lua_script.c
@@ -274,6 +274,18 @@ int LUA_PushGlobals(lua_State *L, const char *word)
 	} else if (fastcmp(word,"tutorialmode")) {
 		lua_pushboolean(L, tutorialmode);
 		return 1;
+	} else if (fastcmp(word, "keepcutscene")) {
+		lua_pushboolean(L, keepcutscene);
+		return 1;
+	} else if (fastcmp(word, "nextgametype")) {
+		lua_pushinteger(L, nextgametype);
+		return 1;
+	} else if (fastcmp(word, "skipstats")) {
+		lua_pushinteger(L, skipstats);
+		return 1;
+	} else if (fastcmp(word, "nextmapoverride")) {
+		lua_pushinteger(L, nextmapoverride);
+		return 1;
 	// end map vars
 	// begin CTF colors
 	} else if (fastcmp(word,"skincolor_redteam")) {
diff --git a/src/p_setup.c b/src/p_setup.c
index 9d6fcca007096349e60dcac397faf6814a21fbf5..296ebbf0acaf51d6d1bd34eb3082ed6fc33824db 100644
--- a/src/p_setup.c
+++ b/src/p_setup.c
@@ -8120,7 +8120,7 @@ boolean P_LoadLevel(boolean fromnetsave, boolean reloadinggamestate)
 		R_PrecacheLevel();
 
 	nextmapoverride = 0;
-	luakeepcutscenes = 0;
+	keepcutscene = false;
 	skipstats = 0;
 
 	levelloading = false;
diff --git a/src/p_spec.c b/src/p_spec.c
index 93809cbb4b68118e4fc4032186c5e772435daba2..ddc97831e3b816a1f147786932aca5cdbc8d2898 100644
--- a/src/p_spec.c
+++ b/src/p_spec.c
@@ -4573,6 +4573,10 @@ static void P_ProcessExitSector(player_t *player, mtag_t sectag)
 
 	if (lines[lineindex].args[1] & TMEF_SKIPTALLY)
 		skipstats = 1;
+
+	//skip stats actually skips post-level cutscenes.
+	if (lines[lineindex].args[1] & TMEF_KEEPCUTSCENE)
+		keepcutscene = true;
 }
 
 static void P_ProcessTeamBase(player_t *player, boolean redteam)
diff --git a/src/p_spec.h b/src/p_spec.h
index ba08781b636cdb0042368c5ff90b5fa0db8c193c..7fd99ac65c38a551f7f8ae6119586bcfdc05090b 100644
--- a/src/p_spec.h
+++ b/src/p_spec.h
@@ -130,6 +130,7 @@ typedef enum
 {
 	TMEF_SKIPTALLY    = 1,
 	TMEF_EMERALDCHECK = 1<<1,
+	TMEF_KEEPCUTSCENE = 1<<2,
 } textmapexitflags_t;
 
 typedef enum