--This script was generously provided by Xian (Huge thanks btw!)
local newrun = true
local timer = 18000
addHook("ThinkFrame", function()
	if newrun != true and gamestate == GS_TITLESCREEN then --restarting, reset run variable
		newrun = true
	end
	if mapheaderinfo[gamemap].lvlttl == "City Escape"
	and leveltime == 1
	and newrun == true
	and not gamecomplete and not multiplayer and not modeattacking then
		timer = 0
		newrun = false --don't let the timer reset if the map is reloaded, like if the player pauses and retries
	end
	if timer < 16800 then
		timer = $ + 1
	end
	if mapheaderinfo[gamemap].lvlttl == "Final Rush"
	and player.exiting
	and timer < 16799 --8 minutes
	and not gamecomplete and not multiplayer and not modeattacking then
		P_LinedefExecute(1)
	end
end)