function onBegin()
	disableMovement()
	waitUntilOnGround()
	say("CC_Deltarune_TheEnd_Pre")
	if choice("CC_Deltarune_TheEnd_PreChoice1","CC_Deltarune_TheEnd_PreChoice2") == 1 then
		player.ForceCameraUpdate = true
		walkTo(2808)
		setFlag("IsEndingTheMap",true)
		wait(0.5)
		playSound("event:/CC/CC_Deltarune/CC_Deltarune_QueenOh")
		say("CC_Deltarune_TheEnd_QueenIntro")
		wait(0.5)
		setFlag("QueenFinalFlip",true)
		wait(1.5)
		setFlag("QueenFinalFlip",false)
		say("CC_Deltarune_TheEnd_QueenIntro2")
		if getFlag("IsHelpingQueen") then
			say("CC_Deltarune_TheEnd_QueenThanks")
		else
			say("CC_Deltarune_TheEnd_QueenEnemy")
		end
	else
		walk(-48)
	end
end
function onEnd(wasSkipped)
	player.ForceCameraUpdate = false
	if (wasSkipped) then
		if not getFlag("IsEndingTheMap") then
			teleport(-48,0)
		end
	end
	enableMovement()
end