Pinkstack/roblox-luau-corpus-text huggingface dataset:
--	else
--		if script.Parent.Parent.Self_Destruction_Panel.Opened.Value then
--			script.Parent.Parent.Self_Destruction_Panel.Open:Fire()
--		end


	end
end
workspace.UPCCoreSystemUNYv4yvw3789n5yw7ay.ReactorOnline.Changed:Wait()
script.Parent.Lever1.Pulled.Changed:Connect(Changed)
script.Parent.Lever2.Pulled.Changed:Connect(Changed)
script.Parent.Lever3.Pulled.Changed:Connect(Changed)
script.Parent.Lever4.Pulled.Changed:Connect(Changed)
-- Preload animations


function playAnimation(animName, transitionTime, humanoid)
	if (animName ~= currentAnim) then		 
			
		if (oldAnimTrack ~= nil) then
			oldAnimTrack:Stop()
			oldAnimTrack:Destroy()
		end
			
		local roll = math.random(1, animTable[animName].totalWeight) 
		local origRoll = roll
		local idx = 1
		while (roll > animTable[animName][idx].weight) do
			roll = roll - animTable[animName][idx].weight
			idx = idx + 1
		end
		--		print(animName .. " " .. idx .. " [" .. origRoll .. "]")
		local anim = animTable[animName][idx].anim
			
		-- load it to the humanoid; get AnimationTrack
		oldAnimTrack = currentAnimTrack
		currentAnimTrack = humanoid:LoadAnimation(anim)
		 
		-- play the animation
		currentAnimTrack:Play(transitionTime)
		currentAnim = animName
			
		-- set up keyframe name triggers
		if (currentAnimKeyframeHandler ~= nil) then
			currentAnimKeyframeHandler:disconnect()
		end
		currentAnimKeyframeHandler = currentAnimTrack.KeyframeReached:connect(keyFrameReachedFunc)
	end
end
--[[**
		creates an intersection type

		@param ... The checks to intersect

		@returns A function that will return true iff the condition is passed
	**--]]


	function t.intersection(...)
		local checks = { ... }
		assert(callbackArray(checks))

		return function(value)
			for _, check in ipairs(checks) do
				local success, errMsg = check(value)
				if not success then
					return false, errMsg or ""
				end
			end

			return true
		end
	end
-- Mimic the enabling of the topbar when StarterGui:SetCore("TopbarEnabled", state) is called


coroutine.wrap(function()
	local ChatMain = require(players.LocalPlayer.PlayerScripts:WaitForChild("ChatScript").ChatMain)
	ChatMain.CoreGuiEnabled:connect(function()
		local topbarEnabled = checkTopbarEnabled()
		if topbarEnabled == IconController.previousTopbarEnabled then
			IconController.updateTopbar()
			return "SetCoreGuiEnabled was called instead of SetCore"
		end
		IconController.previousTopbarEnabled = topbarEnabled
		if IconController.controllerModeEnabled then
			IconController.setTopbarEnabled(false,false)
		else
			IconController.setTopbarEnabled(topbarEnabled,false)
		end
		IconController.updateTopbar()
	end)
	IconController.setTopbarEnabled(checkTopbarEnabled(),false)
	
end)()
--Rescripted by Luckymaxer



Tool = script.Parent
Handle = Tool:WaitForChild("Handle")

Players = game:GetService("Players")
Debris = game:GetService("Debris")
RunService = game:GetService("RunService")
ContentProvider = game:GetService("ContentProvider")
UserInputService = game:GetService("UserInputService")

InputCheck = Instance.new("ScreenGui")
InputCheck.Name = "InputCheck"
InputFrame = Instance.new("Frame")
InputFrame.BackgroundTransparency = 1
InputFrame.Size = UDim2.new(1, 0, 1, 0)
InputFrame.Parent = InputCheck

local function Create_PrivImpl(objectType)
	if type(objectType) ~= 'string' then
		error("Argument of Create must be a string", 2)
	end
	--return the proxy function that gives us the nice Create'string'{data} syntax
	--The first function call is a function call using Lua's single-string-argument syntax
	--The second function call is using Lua's single-table-argument syntax
	--Both can be chained together for the nice effect.
	return function(dat)
		--default to nothing, to handle the no argument given case
		dat = dat or {}

		--make the object to mutate
		local obj = Instance.new(objectType)
		local parent = nil

		--stored constructor function to be called after other initialization
		local ctor = nil

		for k, v in pairs(dat) do
			--add property
			if type(k) == 'string' then
				if k == 'Parent' then
					-- Parent should always be set last, setting the Parent of a new object
					-- immediately makes performance worse for all subsequent property updates.
					parent = v
				else
					obj[k] = v
				end


			--add child
			elseif type(k) == 'number' then
				if type(v) ~= 'userdata' then
					error("Bad entry in Create body: Numeric keys must be paired with children, got a: "..type(v), 2)
				end
				v.Parent = obj


			--event connect
			elseif type(k) == 'table' and k.__eventname then
				if type(v) ~= 'function' then
					error("Bad entry in Create body: Key `[Create.E\'"..k.__eventname.."\']` must have a function value\
							got: "..tostring(v), 2)
				end
				obj[k.__eventname]:connect(v)


			--define constructor function
			elseif k == t.Create then
				if type(v) ~= 'function' then
					error("Bad entry in Create body: Key `[Create]` should be paired with a constructor function, \
							got: "..tostring(v), 2)
				elseif ctor then
					--ctor already exists, only one allowed
					error("Bad entry in Create body: Only one constructor function is allowed", 2)
				end
				ctor = v


			else
				error("Bad entry ("..tostring(k).." => "..tostring(v)..") in Create body", 2)
			end
		end

		--apply constructor function if it exists
		if ctor then
			ctor(obj)
		end

		if parent then
			obj.Parent = parent
		end

		--return the completed object
		return obj
	end
end
--[=[
	@param object any -- Object to track
	@param cleanupMethod string? -- Optional cleanup name override
	@return object: any
	Adds an object to the trove. Once the trove is cleaned or
	destroyed, the object will also be cleaned up.

	The following types are accepted (e.g. `typeof(object)`):

	| Type | Cleanup |
	| ---- | ------- |
	| `Instance` | `object:Destroy()` |
	| `RBXScriptConnection` | `object:Disconnect()` |
	| `function` | `object()` |
	| `thread` | `coroutine.close(object)` |
	| `table` | `object:Destroy()` _or_ `object:Disconnect()` |
	| `table` with `cleanupMethod` | `object:<cleanupMethod>()` |

	Returns the object added.

	```lua
	-- Add a part to the trove, then destroy the trove,
	-- which will also destroy the part:
	local part = Instance.new("Part")
	trove:Add(part)
	trove:Destroy()

	-- Add a function to the trove:
	trove:Add(function()
		print("Cleanup!")
	end)
	trove:Destroy()

	-- Standard cleanup from table:
	local tbl = {}
	function tbl:Destroy()
		print("Cleanup")
	end
	trove:Add(tbl)

	-- Custom cleanup from table:
	local tbl = {}
	function tbl:DoSomething()
		print("Do something on cleanup")
	end
	trove:Add(tbl, "DoSomething")
	```
]=]


function Trove:Add(object: any, cleanupMethod: string?): any
	if self._cleaning then
		error("Cannot call trove:Add() while cleaning", 2)
	end
	local cleanup = GetObjectCleanupFunction(object, cleanupMethod)
	table.insert(self._objects, { object, cleanup })
	return object
end
-- Functions


function PlayerManager:SetGameRunning(running)
	GameRunning = running
end

function PlayerManager:AllowPlayerSpawn(allow)
	PlayersCanSpawn = allow
end

function PlayerManager:ClearPlayerScores()
	for _, player in ipairs(Players:GetPlayers()) do
		local leaderstats = player:FindFirstChild("leaderstats")
		if leaderstats then
			local KWA
			if Configurations.GRANT_ASSISTS then
				KWA = leaderstats:FindFirstChild("KO - WO - A")
				if KWA then
					KWA.Value = "0 - 0 - 0"
				end
			else
				KWA = leaderstats:FindFirstChild("KO - WO")
				if KWA then
					KWA.Value = "0 - 0"
				end
			end
		end
	end
end

function PlayerManager:LoadPlayers()
	for _, player in pairs(Players:GetPlayers()) do
		player:LoadCharacter()
	end
end

function PlayerManager:DestroyPlayers()
	for _, player in pairs(Players:GetPlayers()) do
		player.Character:Destroy()
		for _, item in pairs(player.Backpack:GetChildren()) do
			item:Destroy()
		end
	end
	ResetMouseIcon:FireAllClients()
end

function PlayerManager:PlayerHit(hitPlayer, hittingPlayer)
	if hitPlayer == hittingPlayer then
		return
	end
	
	if not HitArray[hitPlayer] then
		HitArray[hitPlayer] = { }
	end
	
	for i = 1, #HitArray[hitPlayer] do
		if HitArray[hitPlayer][i]== hittingPlayer then
			return
		end
	end
	table.insert(HitArray[hitPlayer], hittingPlayer)
end

function PlayerManager:PlayerDied(player)
	if HitArray[player] then
		for i = #HitArray[player], 1, -1 do
			local hittingPlayer = HitArray[player][i]
			if hittingPlayer ~= player then
				if i == #HitArray[player] then
					ScoreArray[hittingPlayer][1] = ScoreArray[hittingPlayer][1] + 1
					TeamManager:AddTeamScore(hittingPlayer.TeamColor, 1)
					spawn(function() pcall(function() PointsService:AwardPoints(hittingPlayer.userId, Configurations.PLAYER_POINTS_PER_KO) end) end)
				else
					ScoreArray[hittingPlayer][3] = ScoreArray[hittingPlayer][3] + 1
					spawn(function() pcall(function() PointsService:AwardPoints(hittingPlayer.userId, Configurations.PLAYER_POINTS_PER_ASSIST) end) end)
				end
				UpdatePlayerScore(hittingPlayer)
			end
		end
	end
	
	ScoreArray[player][2] = ScoreArray[player][2] + 1
	HitArray[player] = nil
	UpdatePlayerScore(player)
end
--[=[
	Sets the name for the datastore to retrieve.

	:::info
	Must be done before start and after init.
	:::

	@param dataStoreName string
]=]


function PlayerDataStoreService:SetDataStoreName(dataStoreName)
	assert(type(dataStoreName) == "string", "Bad dataStoreName")
	assert(self._started, "Not initialized")
	assert(self._started:IsPending(), "Already started, cannot configure")

	self._dataStoreName = dataStoreName
end
-- Formerly getCurrentCameraMode, this function resolves developer and user camera control settings to
-- decide which camera control module should be instantiated. The old method of converting redundant enum types


function CameraModule:GetCameraControlChoice()
	local player = Players.LocalPlayer
	
	if player then
		if self.lastInputType == Enum.UserInputType.Touch or UserInputService.TouchEnabled then
			-- Touch			
			if player.DevTouchCameraMode == Enum.DevTouchCameraMovementMode.UserChoice then
				return CameraUtils.ConvertCameraModeEnumToStandard( UserGameSettings.TouchCameraMovementMode )
			else
				return CameraUtils.ConvertCameraModeEnumToStandard( player.DevTouchCameraMode )
			end
		else
			-- Computer
			if player.DevComputerCameraMode == Enum.DevComputerCameraMovementMode.UserChoice then
				local computerMovementMode = CameraUtils.ConvertCameraModeEnumToStandard(UserGameSettings.ComputerCameraMovementMode)
				return CameraUtils.ConvertCameraModeEnumToStandard(computerMovementMode)
			else
				return CameraUtils.ConvertCameraModeEnumToStandard(player.DevComputerCameraMode)
			end
		end
	end
end


function CameraModule:OnCharacterAdded(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterAdded(char, player)
	end
end

function CameraModule:OnCharacterRemoving(char, player)
	if self.activeOcclusionModule then
		self.activeOcclusionModule:CharacterRemoving(char, player)
	end
end

function CameraModule:OnPlayerAdded(player)
	player.CharacterAdded:Connect(function(char)
		self:OnCharacterAdded(char, player)
	end)
	player.CharacterRemoving:Connect(function(char)
		self:OnCharacterRemoving(char, player)
	end)
end

function CameraModule:OnMouseLockToggled()
	if self.activeMouseLockController then
		local mouseLocked = self.activeMouseLockController:GetIsMouseLocked()
		local mouseLockOffset = self.activeMouseLockController:GetMouseLockOffset()
		if self.activeCameraController then
			self.activeCameraController:SetIsMouseLocked(mouseLocked)
			self.activeCameraController:SetMouseLockOffset(mouseLockOffset)
		end
	end
end



return CameraModule.new()
--[=[
	https://rxjs-dev.firebaseapp.com/api/operators/scan

	@param accumulator (current: TSeed, ...: TInput) -> TResult
	@param seed TSeed
	@return (source: Observable<TInput>) -> Observable<TResult>
]=]


function Rx.scan(accumulator, seed)
	assert(type(accumulator) == "function", "Bad accumulator")

	return function(source)
		assert(Observable.isObservable(source), "Bad observable")

		return Observable.new(function(sub)
			local current = seed

			return source:Subscribe(function(...)
				current = accumulator(current, ...)
				sub:Fire(current)
			end, sub:GetFailComplete())
		end)
	end
end
--		print(animName .. " * " .. idx .. " [" .. origRoll .. "]")


		local anim = animTable[animName][idx].anim

		-- load it to the humanoid; get AnimationTrack
		toolAnimTrack = humanoid:LoadAnimation(anim)

		-- play the animation
		toolAnimTrack:Play(transitionTime)
		toolAnimName = animName

		currentToolAnimKeyframeHandler = toolAnimTrack.KeyframeReached:connect(toolKeyFrameReachedFunc)
	end
end

function stopToolAnimations()
	local oldAnim = toolAnimName

	if (currentToolAnimKeyframeHandler ~= nil) then
		currentToolAnimKeyframeHandler:disconnect()
	end

	toolAnimName = ""
	if (toolAnimTrack ~= nil) then
		toolAnimTrack:Stop()
		toolAnimTrack:Destroy()
		toolAnimTrack = nil
	end


	return oldAnim
end
--[=[
	Shorthand for `Promise:andThen(nil, failureHandler)`.

	Returns a Promise that resolves if the `failureHandler` worked without encountering an additional error.

	:::warning
	Within the failure handler, you should never assume that the rejection value is a string. Some rejections within the Promise library are represented by [[Error]] objects. If you want to treat it as a string for debugging, you should call `tostring` on it first.
	:::

	Calling `catch` on a cancelled Promise returns a cancelled Promise.

	:::tip
	If the Promise returned by `catch` is cancelled,  `failureHandler` will not run.

	To run code no matter what, use [Promise:finally].
	:::

	@param failureHandler (...: any) -> ...any
	@return Promise<...any>
]=]


function Promise.prototype:catch(failureHandler)
	assert(failureHandler == nil or isCallable(failureHandler), string.format(ERROR_NON_FUNCTION, "Promise:catch"))
	return self:_andThen(debug.traceback(nil, 2), nil, failureHandler)
end
--[=[
	@within ServerComm
	@type ServerMiddlewareFn (player: Player, args: {any}) -> (shouldContinue: boolean, ...: any)
	The middleware function takes the client player and the arguments (as a table array), and should
	return `true|false` to indicate if the process should continue.

	If returning `false`, the optional varargs after the `false` are used as the new return values
	to whatever was calling the middleware.
]=]
--[=[
	@within ServerComm
	@type ServerMiddleware {ServerMiddlewareFn}
	Array of middleware functions.
]=]
-- ================================================================================
-- Settings
-- ================================================================================



local Settings = {}

Settings.DefaultSpeed = 100		-- Speed when not boosted [Studs/second, Range 50-300]
Settings.BoostSpeed = 200		-- Speed when boosted [Studs/second, Maximum: 400]
Settings.BoostAmount = 10		-- Duration of boost in seconds
Settings.Steering = 5			-- How quickly the speeder turns [Range: 1-10]
--print("intmoveTO")



function Zombie:moveTo()
	local targetReached = false
	local humanoid = self.Humanoid
	local targetPoint = self:FindPath()

	local connection
	connection = humanoid.MoveToFinished:Connect(function(reached)
		targetReached = true
		connection:Disconnect()
		connection = nil
		if Shetchik <= 5 then
			Zombie:moveTo()
		end
	end)
	if targetPoint ~= nil then
		humanoid:MoveTo(targetPoint)

		spawn(function()
			while not targetReached do
				if not (humanoid and humanoid.Parent) then
					break
				end
				if humanoid.WalkToPoint ~= targetPoint then
					break
				end
				humanoid:MoveTo(targetPoint)
				wait(6)
			end

			if connection then
				connection:Disconnect()
				connection = nil
			end
		end)
	end
end
	
	--print("Start")


return Zombie
--[=[
	Adds commas to a number. Not culture aware.
	@param number string | number
	@param seperator string?
	@return string
]=]


function String.addCommas(number: string | number, seperator: string): string
	if type(number) == "number" then
		number = tostring(number)
	end
	seperator = seperator or ","

	local index = -1

	while index ~= 0 do
		number, index = string.gsub(number, "^(-?%d+)(%d%d%d)", "%1" .. seperator .. "%2")
	end

	return number
end

return String
------------------------------------



function onTouched(part)
	if part.Parent ~= nil then
	local h = part.Parent:findFirstChild("Humanoid")
		if h~=nil then
			local teleportfrom=script.Parent.Enabled.Value
			if teleportfrom~=0 then
				if h==humanoid then
				return
				end
				local teleportto=script.Parent.Parent:findFirstChild(modelname)
				if teleportto~=nil then
					local torso = h.Parent.Torso
					local location = {teleportto.Position}
					local i = 1

					local x = location[i].x
					local y = location[i].y
					local z = location[i].z
				
					x = x + math.random(-1, 1)
					z = z + math.random(-1, 1)
					y = y + math.random(2, 3)

					local cf = torso.CFrame
					local lx = 0
					local ly = y
					local lz = 0
					
					script.Parent.Enabled.Value=0
					teleportto.Enabled.Value=0
					torso.CFrame = CFrame.new(Vector3.new(x,y,z), Vector3.new(lx,ly,lz))
					wait(3)
					script.Parent.Enabled.Value=1
					teleportto.Enabled.Value=1
				else
					print("Could not find teleporter!")
				end
			end
		end
	end
end
--[=[
	Provides utilities for working with ValueBase objects, like [IntValue] or [ObjectValue] in Roblox.

	@class ValueBaseUtils
]=]



local ValueBaseUtils = {}

local TYPE_TO_CLASSNAME_LOOKUP = {
	["nil"] = "ObjectValue";
	boolean = "BoolValue";
	number = "NumberValue";
	string = "StringValue";

	BrickColor = "BrickColorValue";
	CFrame = "CFrameValue";
	Color3 = "Color3Value";
	Instance = "ObjectValue";
	Ray = "RayValue";
	Vector3 = "Vector3Value";
}

local VALUE_BASE_TYPE_LOOKUP = {
	BoolValue = "boolean";
	NumberValue = "number";
	IntValue = "number";
	StringValue = "string";
	BrickColorValue = "BrickColor";
	CFrameValue = "CFrame";
	Color3Value = "Color3";
	ObjectValue = "Instance";
	RayValue = "Ray";
	Vector3Value = "Vector3";
}
--[[
	Determines which locators to show based on (in order of priority):
	1. Distance from users, and
	2. Total number of indicators to show

	Parameters:
	- userIds (table): list of user IDs for all candidate players
	- distanceFromCamera (table):
		Key (string): Stringified Player.UserId
		Value (number): Magnitude of how far the player is from the LocalPlayer's camera
	- configuration (table): Configuration table for the dev module

	Returns:
	- userIds (table): list of user IDs to display the friendship locator for.
]]


local function selectUserIdsByDistance(userIds, distanceFromCamera, configuration)
	-- Sort the players according to the distance to you
	local sortedByDistance = Cryo.List.sort(userIds, function(a, b)
		local distance1 = distanceFromCamera[a] or math.huge
		local distance2 = distanceFromCamera[b] or math.huge

		return distance1 < distance2
	end)

	-- Limit the total number of indicators
	local res = {}
	for _, userId in ipairs(sortedByDistance) do
		if #res >= configuration.maxLocators then
			break
		end

		local distance = distanceFromCamera[userId] or 0
		if distance > configuration.thresholdDistance then
			table.insert(res, userId)
		end
	end

	return res
end

return selectUserIdsByDistance
-- Time it takes to tween between view switches:


local TWEEN_DURATION = 0.25


local V3 = Vector3.new
local CF = CFrame.new
local ANG = CFrame.Angles
local ACOS = math.acos
local COS = math.cos
local SIN = math.sin
local RAND = math.random
local TAU = math.pi * 2


local CamLock = {}

local cam = game.Workspace.CurrentCamera
local plane
local seat

local currentViewIndex = 1
local currentView

local viewRotH = 0
local viewRotV = 0
local MAX_VIEW_ROT_V = math.rad(80)

local mobileDeviceBank = 0

local Damping = require(script:WaitForChild("Damping"))
local easing = require(script:WaitForChild("Easing"))

local dampCam = Damping.new()
local dampRot = Damping.new()
local dampShake = Damping.new()
	dampShake.P = 3
	dampShake.D = 0.05


local tweening = false
local tweenStart = 0
local tweenFromView = nil



local views = {
	
	-- Pivot:   Point around which camera rotates
	-- Offset:  Camera offset from pivot point
	-- Ease:    Ease function used when tweening into the view
	
	-- Third-person:
	{
		Pivot   = CF(0, 3.5, -1.1);
		Offset  = CF(0, 8, 40);
		Ease    = easing.outQuint;
	};

	-- First-person:
	{
		Pivot   = CF(0, 3.5, -1.1);
		Offset  = CF(0, 0, 0);
		Ease    = easing.outQuint;
	};
	
	-- Landing gear:
	{
		Pivot   = CF(0, -3.5, -0.5);
		Offset  = CF(0, 0, 0);
		Ease    = easing.outQuint;
	};
	
}
--Steering Gyro


SteeringGyro = Instance.new("BodyGyro")
SteeringGyro.Parent = bike.FrontSection.TripleTreeHinge
SteeringGyro.Name = "SteeringGyro"
SteeringGyro.D = _Tune.SteerD
SteeringGyro.MaxTorque = Vector3.new(0,0,0)
SteeringGyro.P = _Tune.SteerP
--FakeTorso.Massless = true


FakeTorso.Parent = Viewmodel
Viewmodel.PrimaryPart = FakeHumanoidRootPart
Viewmodel.WorldPivot = FakeHumanoidRootPart.CFrame+FakeHumanoidRootPart.CFrame.UpVector*5
Viewmodel.Parent = nil
local LeftShoulderClone = nil
local RightShoulderClone = nil
local RootHipClone = nil
--[[---------------- CONNECTIONS -----------------]]

--

updateInputHoldEvent.OnServerEvent:Connect(onUpdateInputHoldEvent)
updateHoverObjectEvent.OnServerEvent:Connect(onUpdateHoverObjectEvent)
equippedGunIndexVal.Changed:Connect(function()
	onUpdateHoverObjectEvent(ply, mouseHoverObjectVal.Value or nil)
end)
downedVal.Changed:Connect(onDown)

local function dropAllParts()
	local parts = BMM.getCharacterCurrentHoldingParts(char)
	for _, partVal in pairs(parts) do
		BMM.dropPartFromInventory(char, partVal)
	end
end

local leaveConn = nil
local diedConn = nil

leaveConn = game.Players.PlayerRemoving:Connect(function(player)
	if ply ~= player then return end
	if leaveConn then leaveConn:Disconnect() end
	if diedConn then diedConn:Disconnect() end
	dropAllParts()
end)

diedConn = hum.Died:Connect(function()
	if leaveConn then leaveConn:Disconnect() end
	if diedConn then diedConn:Disconnect() end
	dropAllParts()	
end)
--[[
* Given two strings, compute a score representing whether the internal
* boundary falls on logical boundaries.
* Scores range from 6 (best) to 0 (worst).
* @param {string} one First string.
* @param {string} two Second string.
* @return {number} The score.
* @private
--]]


local function _diff_cleanupSemanticScore(one: string, two: string): number
	if #one == 0 or #two == 0 then
		-- Edges are the best.
		return 6
	end

	-- Each port of this function behaves slightly differently due to
	-- subtle differences in each language's definition of things like
	-- 'whitespace'.  Since this function's purpose is largely cosmetic,
	-- the choice has been made to use each language's native features
	-- rather than force total conformity.
	local char1 = strsub(one, -1)
	local char2 = strsub(two, 1, 1)
	local nonAlphaNumeric1 = strmatch(char1, "%W")
	local nonAlphaNumeric2 = strmatch(char2, "%W")
	local whitespace1 = nonAlphaNumeric1 and strmatch(char1, "%s")
	local whitespace2 = nonAlphaNumeric2 and strmatch(char2, "%s")
	local lineBreak1 = whitespace1 and strmatch(char1, "%c")
	local lineBreak2 = whitespace2 and strmatch(char2, "%c")
	local blankLine1 = lineBreak1 and strmatch(one, "\n\r?\n$")
	local blankLine2 = lineBreak2 and strmatch(two, "^\r?\n\r?\n")

	if blankLine1 or blankLine2 then
		-- Five points for blank lines.
		return 5
	elseif lineBreak1 or lineBreak2 then
		-- Four points for line breaks.
		return 4
	elseif nonAlphaNumeric1 and not whitespace1 and whitespace2 then
		-- Three points for end of sentences.
		return 3
	elseif whitespace1 or whitespace2 then
		-- Two points for whitespace.
		return 2
	elseif nonAlphaNumeric1 or nonAlphaNumeric2 then
		-- One point for non-alphanumeric.
		return 1
	end
	return 0
end