Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[
	Create a new expectation
]]


function Expectation.new(value)
	local self = {
		value = value,
		successCondition = true,
		condition = false,
		matchers = {},
		_boundMatchers = {},
	}

	setmetatable(self, Expectation)

	self.a = bindSelf(self, self.a)
	self.an = self.a
	self.ok = bindSelf(self, self.ok)
	self.equal = bindSelf(self, self.equal)
	self.throw = bindSelf(self, self.throw)
	self.near = bindSelf(self, self.near)

	return self
end

function Expectation.checkMatcherNameCollisions(name)
	if SELF_KEYS[name] or NEGATION_KEYS[name] or Expectation[name] then
		return false
	end

	return true
end

function Expectation:extend(matchers)
	self.matchers = matchers or {}

	for name, implementation in pairs(self.matchers) do
		self._boundMatchers[name] = bindSelf(self, function(_self, ...)
			local result = implementation(self.value, ...)
			local pass = result.pass == self.successCondition

			assertLevel(pass, result.message, 3)
			self:_resetModifiers()
			return self
		end)
	end

	return self
end

function Expectation.__index(self, key)
	-- Keys that don't do anything except improve readability
	if SELF_KEYS[key] then
		return self
	end

	-- Invert your assertion
	if NEGATION_KEYS[key] then
		local newExpectation = Expectation.new(self.value):extend(self.matchers)
		newExpectation.successCondition = not self.successCondition

		return newExpectation
	end

	if self._boundMatchers[key] then
		return self._boundMatchers[key]
	end

	-- Fall back to methods provided by Expectation
	return Expectation[key]
end
--///////////////// Internal-Use Methods
--//////////////////////////////////////
--DO NOT REMOVE THIS. Chat must be filtered or your game will face
--moderation.


function methods:InternalApplyRobloxFilter(speakerName, message, toSpeakerName) --// USES FFLAG
	if (RunService:IsServer() and not RunService:IsStudio()) then
		local fromSpeaker = self:GetSpeaker(speakerName)
		local toSpeaker = toSpeakerName and self:GetSpeaker(toSpeakerName)

		if fromSpeaker == nil then
			return nil
		end

		local fromPlayerObj = fromSpeaker:GetPlayer()
		local toPlayerObj = toSpeaker and toSpeaker:GetPlayer()

		if fromPlayerObj == nil then
			return message
		end

		local filterStartTime = tick()
		local filterRetries = 0
		while true do
			local success, message = pcall(function()
				if toPlayerObj then
					return Chat:FilterStringAsync(message, fromPlayerObj, toPlayerObj)
				else
					return Chat:FilterStringForBroadcast(message, fromPlayerObj)
				end
			end)
			if success then
				return message
			else
				warn("Error filtering message:", message)
			end
			filterRetries = filterRetries + 1
			if filterRetries > MAX_FILTER_RETRIES or (tick() - filterStartTime) > MAX_FILTER_DURATION then
				self:InternalNotifyFilterIssue()
				return nil
			end
			local backoffInterval = FILTER_BACKOFF_INTERVALS[math.min(#FILTER_BACKOFF_INTERVALS, filterRetries)]
			-- backoffWait = backoffInterval +/- (0 -> backoffInterval)
			local backoffWait = backoffInterval + ((math.random()*2 - 1) * backoffInterval)
			wait(backoffWait)
		end
	else
		--// Simulate filtering latency.
		--// There is only latency the first time the message is filtered, all following calls will be instant.
		if not StudioMessageFilteredCache[message] then
			StudioMessageFilteredCache[message] = true
			wait()
		end
		return message
	end

	return nil
end
--[=[
	Used to test that the given GuiObject or Rect is left, center, or right
	aligned with the other GuiObject or Rect.

	This can be especially useful to determine if a given pair of elements are
	under the influence of the same `UIListLayout`.

	```lua
	expect(a).toBeAlignedHorizontally(b, Enum.HorizontalAlignment.Left) -- Jest
	expect(a).to.be.alignedHorizontally(b, Enum.HorizontalAlignment.Left) -- TestEZ
	```

	![Example of alignedHorizontally(a, b, Enum.HorizontalAlignment.Left)](/alignedHorizontally(a,%20b,%20Enum.HorizontalAlignment.Left).png)

	```lua
	expect(a).toBeAlignedHorizontally(b, Enum.HorizontalAlignment.Right) -- Jest
	expect(a).to.be.alignedHorizontally(b, Enum.HorizontalAlignment.Right) -- TestEZ
	```

	![Example of alignedHorizontally(a, b, Enum.HorizontalAlignment.Right)](/alignedHorizontally(a,%20b,%20Enum.HorizontalAlignment.Right).png)

	@tag alignment
	@within CollisionMatchers2D
]=]


local function alignedHorizontally(
	a: GuiObject | Rect,
	b: GuiObject | Rect,
	horizontalAlignment: Enum.HorizontalAlignment
)
	local aRect = toRect(a)
	local bRect = toRect(b)

	if horizontalAlignment == Enum.HorizontalAlignment.Left then
		return returnValue(aRect.Min.X == bRect.Min.X, "", "")
	elseif horizontalAlignment == Enum.HorizontalAlignment.Center then
		local aMiddle = (aRect.Min + aRect.Max) / 2
		local bMiddle = (bRect.Min + bRect.Max) / 2
		return returnValue(aMiddle.X == bMiddle.X, "", "")
	elseif horizontalAlignment == Enum.HorizontalAlignment.Right then
		return returnValue(aRect.Max.X == bRect.Max.X, "", "")
	end

	return returnValue(false, "Invalid horizontal alignment!")
end

return alignedHorizontally
---------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------------



rs.RenderStepped:connect(function ()
	if active then
		if waveScale < 0.5 then
			waveScale = math.min(0.5,waveScale+scaleIncrement)
		end
	else
		if waveScale > 0 then
			waveScale = math.max(0,waveScale-scaleIncrement)
		end
	end
	local abs,cos = math.abs,math.cos
	local camY = c.CoordinateFrame.lookVector.Y
	for joint,def in pairs(RIG) do
		joint.C0 = def.C0 * CFrame.Angles(def.Factor.X*camY,def.Factor.Y*camY,def.Factor.Z*camY)
		joint.C1 = def.C1
	end
	rootJ.C0 = rootJ.C0 * CFrame.new(0,camY,0) -- Painful fix, but the player glides forward and backwards a bit when looking up and down without this.
	local headOffset = CFrame.new()
	if (c.Focus.p-c.CoordinateFrame.p).magnitude < 1 then
		if script.Parent.Parent.PlayerGui.GUI.Asset.Jar.Stamina.Spectation.Running.Value == false then
		c.FieldOfView = 100
		end
		local dist = head.CFrame:toObjectSpace(torso.CFrame).p.magnitude
		headOffset = root.CFrame:toObjectSpace(head.CFrame) - Vector3.new(0,dist - ((1+camY)/8),0.25)
	else
		if script.Parent.Parent.PlayerGui.GUI.Asset.Jar.Stamina.Spectation.Running.Value == false then
		c.FieldOfView = 80
	end
	end
	local t = cos(tick() * (math.pi*2.5))
	local bobble = CFrame.new((t/3)*waveScale,abs(t/5)*waveScale,0) -- Makes the view move side to side. The wave scale is tweened between 0 and 1 depending on if the player is walking or not.
	humanoid.CameraOffset = (headOffset * bobble).p
end)
--[[
	Calls a function and throws an error if it attempts to yield.

	Pass any number of arguments to the function after the callback.

	This function supports multiple return; all results returned from the
	given function will be returned.
]]



local function resultHandler(co, ok, ...)
	if not ok then
		local message = (...)
		error(debug.traceback(co, message), 2)
	end

	if coroutine.status(co) ~= "dead" then
		error(debug.traceback(co, "Attempted to yield inside changed event!"), 2)
	end

	return ...
end

local function NoYield(callback, ...)
	local co = coroutine.create(callback)

	return resultHandler(co, coroutine.resume(co, ...))
end

return NoYield
--[=[
	Takes in an observable of brios and returns an observable of the inner values that will also output
	nil if there is no other value for the brio.

	@param emitOnDeathValue U
	@return (source: Observable<Brio<T> | T>) -> Observable<T | U>
]=]


function RxBrioUtils.emitOnDeath(emitOnDeathValue)
	return Rx.switchMap(function(brio)
		return RxBrioUtils.toEmitOnDeathObservable(brio, emitOnDeathValue)
	end);
end
-- LOCAL


local starterGui = game:GetService("StarterGui")
local guiService = game:GetService("GuiService")
local hapticService = game:GetService("HapticService")
local runService = game:GetService("RunService")
local userInputService = game:GetService("UserInputService")
local tweenService = game:GetService("TweenService")
local players = game:GetService("Players")
local VRService = game:GetService("VRService")
local voiceChatService = game:GetService("VoiceChatService")
local iconModule = script.Parent
local TopbarPlusReference = require(iconModule.TopbarPlusReference)
local referenceObject = TopbarPlusReference.getObject()
local leadPackage = referenceObject and referenceObject.Value
if leadPackage and leadPackage.IconController ~= script then
	return require(leadPackage.IconController)
end
if not referenceObject then
    TopbarPlusReference.addToReplicatedStorage()
end
local IconController = {}
local Signal = require(iconModule.Signal)
local TopbarPlusGui = require(iconModule.TopbarPlusGui)
local topbarIcons = {}
local forceTopbarDisabled = false
local menuOpen
local topbarUpdating = false
local cameraConnection
local controllerMenuOverride
local isStudio = runService:IsStudio()
local localPlayer = players.LocalPlayer
local voiceChatIsEnabledForUserAndWithinExperience = false
local disableControllerOption = false
local STUPID_CONTROLLER_OFFSET = 32
--[=[
	Constructs a new CancelToken

	@param executor (cancel: () -> ()) -> ()
	@return CancelToken
]=]


function CancelToken.new(executor)
	local self = setmetatable({}, CancelToken)

	assert(type(executor) == "function", "Bad executor")

	self.PromiseCancelled = Promise.new()

	self.Cancelled = Signal.new()

	self.PromiseCancelled:Then(function()
		self.Cancelled:Fire()
		self.Cancelled:Destroy()
	end)

	executor(function()
		self:_cancel()
	end)

	return self
end
-- Standard saving of data stores
-- The key you provide to DataStore2 is the name of the store with GetDataStore
-- GetAsync/UpdateAsync are then called based on the user ID


local DataStoreServiceRetriever = require(script.Parent.Parent.DataStoreServiceRetriever)
local Promise = require(script.Parent.Parent.Promise)

local Standard = {}
Standard.__index = Standard

function Standard:Get()
	return Promise.async(function(resolve)
		resolve(self.dataStore:GetAsync(self.userId))
	end)
end

function Standard:Set(value)
	return Promise.async(function(resolve)
		self.dataStore:UpdateAsync(self.userId, function()
			return value
		end)

		resolve()
	end)
end

function Standard.new(dataStore2)
	return setmetatable({
		dataStore = DataStoreServiceRetriever.Get():GetDataStore(dataStore2.Name),
		userId = dataStore2.UserId,
	}, Standard)
end

return Standard
-- ScriptConnection object:



local ScriptConnection = {
	--[[
		_listener = listener,
		_script_signal = script_signal,
		_disconnect_listener = disconnect_listener,
		_disconnect_param = disconnect_param,
		
		_next = next_script_connection,
		_is_connected = is_connected,
	--]]
}
ScriptConnection.__index = ScriptConnection

function ScriptConnection:Disconnect()

	if self._is_connected == false then
		return
	end

	self._is_connected = false
	self._script_signal._listener_count -= 1

	if self._script_signal._head == self then
		self._script_signal._head = self._next
	else
		local prev = self._script_signal._head
		while prev ~= nil and prev._next ~= self do
			prev = prev._next
		end
		if prev ~= nil then
			prev._next = self._next
		end
	end

	if self._disconnect_listener ~= nil then
		if not FreeRunnerThread then
			FreeRunnerThread = coroutine.create(RunEventHandlerInFreeThread)
		end
		task.spawn(FreeRunnerThread, self._disconnect_listener, self._disconnect_param)
		self._disconnect_listener = nil
	end

end
-- ================================================================================
-- Settings - Beast
-- ================================================================================



local Settings = {}

Settings.DefaultSpeed = 95		-- Speed when not boosted [Studs/second, Range 50-300]
Settings.BoostSpeed = 150		-- Speed when boosted [Studs/second, Maximum: 400]
Settings.BoostAmount = 12		-- Duration of boost in seconds
Settings.Steering = 4		 	-- How quickly the speeder turns [Range: 1-10]
--- Registers a type in the system.
-- name: The type Name. This must be unique.


function Registry:RegisterType (name, typeObject)
	if not name or not typeof(name) == "string" then
		error("Invalid type name provided: nil")
	end

	if not name:find("^[%d%l]%w*$") then
		error(('Invalid type name provided: "%s", type names must be alphanumeric and start with a lower-case letter or a digit.'):format(name))
	end

	for key in pairs(typeObject) do
		if self.TypeMethods[key] == nil then
			error("Unknown key/method in type \"" .. name .. "\": " .. key)
		end
	end

	if self.Types[name] ~= nil then
		error(('Type "%s" has already been registered.'):format(name))
	end

	typeObject.Name = name
	typeObject.DisplayName = typeObject.DisplayName or name

	self.Types[name] = typeObject
end
--["Walk"] = "rbxassetid://1136173829",


["Walk"] = "http://www.roblox.com/asset/?id=507767714",
["Idle"] = "http://www.roblox.com/asset/?id=507766666",
["SwingTool"] = "rbxassetid://1262318281"
}
local anims = {}
for animName,animId in next,preAnims do
local anim = Instance.new("Animation")
anim.AnimationId = animId
game:GetService("ContentProvider"):PreloadAsync({anim})
anims[animName] = animController:LoadAnimation(anim)
end


local fallConstant = -2
run.Heartbeat:connect(function()
	local part,pos,norm,mat = workspace:FindPartOnRay(Ray.new(root.Position,Vector3.new(0,-2.8,0)),char)
	if target.Value then
	local facingCFrame = CFrame.new(Vector3.new(root.CFrame.X,pos.Y+6.8,root.CFrame.Z),CFrame.new(target.Value.CFrame.X,pos.Y+3,target.Value.CFrame.Z).p)
	bg.CFrame = facingCFrame
	else
	--bg.CFrame = CFrame.new(root.CFrame.X,pos.Y+3,root.CFrame.Z)
	end
	if target.Value then
		bv.P = 100000
		bv.Velocity = root.CFrame.lookVector*14
		if not part then
			bv.Velocity = bv.Velocity+Vector3.new(0,fallConstant,0)
			fallConstant = fallConstant-1
		else
			fallConstant = -2
		end
		if not anims["Walk"].IsPlaying then
		anims["Walk"]:Play()
		end
	else
		bv.P = 0
		bv.Velocity = Vector3.new(0,0,0)
		anims["Walk"]:Stop()
anims["Idle"]:Play()
	end
end)

while wait(1) do
	local thresh,nearest = 120,nil
	for _,player in next,game.Players:GetPlayers() do
		if player.Character and player.Character.PrimaryPart then
			local dist = (player.Character.PrimaryPart.Position-root.Position).magnitude
			if dist < thresh then
				thresh = dist
				nearest = player.Character.PrimaryPart
			end
		end		
	end
	if nearest then
if thresh < 8 then
anims["SwingTool"]:Play()
			
local plr = game.Players:GetPlayerFromCharacter(nearest.Parent)

_G.SD[plr.UserId].Data.stats.health = _G.SD[plr.UserId].Data.stats.health - 24
			
if _G.SD[plr.UserId].Data.stats.health < 1 then
	plr.Character:BreakJoints()
end
			
target.Value = nil
wait(1)
end
		target.Value = nearest
	else
		target.Value = nil
	end
end
--Driver Sit	


bike.DriveSeat.ChildAdded:connect(function(child)
	if child.Name=="SeatWeld" and child:IsA("Weld") and game.Players:GetPlayerFromCharacter(child.Part1.Parent)~=nil then
		--Distribute Client Interface
		local p=game.Players:GetPlayerFromCharacter(child.Part1.Parent)
		bike.DriveSeat:SetNetworkOwner(p)
		local g=script.Parent.Interface:Clone()
		g.Parent=p.PlayerGui
	end
end)
--edit the below function to execute code when this response is chosen OR this prompt is shown
--player is the player speaking to the dialogue, and dialogueFolder is the object containing the dialogue data


return function(player, dialogueFolder)
	local ClassInformationTable = require(game.ReplicatedStorage.Source.Modules.CharacterScripts.Classes.ClassInformation)
	ClassInformationTable:GetClassFolder(player,"Warlock").Obtained.Value = true
	ClassInformationTable:GetClassFolder(player,"Warlock").Firespread.Value = true
	local plrData = require(game.ReplicatedStorage.Source.Modules.Util):GetPlayerData(player)
	plrData.Money.Gold.Value = plrData.Money.Gold.Value - 70 -- TODO Track payment for dissertation
end
-- Event Handlers


function Input:_checkDown (userInput, isDown)
	if (not self:_isDown (userInput)) then return end
	
	self._isMouseDown = isDown;
	if (not isDown) then
		self.ButtonUp:Fire ();
	end
end

function Input:_checkMouseMoved (userInput, isTouch)
	if (not isTouch and not self:_isMovement (userInput)) then return end;
	
	if (not self._isMouseDown) then
		self.MouseMoved:Fire (userInput.Position);	
	else
		self.Dragged:Fire (userInput.Position, isTouch);
	end;
end
--[[
	
	Works exactly like the real DataStore.

	safeDataStore.Failed(method, key, errorMessage)
	
--]]





local SafeDataStore = {}
SafeDataStore.__index = SafeDataStore

local MAX_ATTEMPTS = 5
local ATTEMPT_INTERVAL = 2


local dataStoreService = game:GetService("DataStoreService")
if (game.PlaceId == 0) then
	dataStoreService = require(script:WaitForChild("MockDataStoreService"))
end
--[=[
	Registers a callback that runs when an unhandled rejection happens. An unhandled rejection happens when a Promise
	is rejected, and the rejection is not observed with `:catch`.

	The callback is called with the actual promise that rejected, followed by the rejection values.

	@param callback (promise: Promise, ...: any) -- A callback that runs when an unhandled rejection happens.
	@return () -> () -- Function that unregisters the `callback` when called
]=]


function Promise.onUnhandledRejection(callback)
	table.insert(Promise._unhandledRejectionCallbacks, callback)

	return function()
		local index = table.find(Promise._unhandledRejectionCallbacks, callback)

		if index then
			table.remove(Promise._unhandledRejectionCallbacks, index)
		end
	end
end

return Promise
--[=[
	Promises a user thumbnail with retry enabled.

	```lua
	PlayerThumbnailUtils.promiseUserThumbnail(4397833):Then(function(image)
		imageLabel.Image = image
	end)
	```
	@param userId number
	@param thumbnailType ThumbnailType?
	@param thumbnailSize ThumbnailSize?
	@return Promise<string>
]=]


function PlayerThumbnailUtils.promiseUserThumbnail(userId, thumbnailType, thumbnailSize)
	assert(type(userId) == "number", "Bad userId")
	thumbnailType = thumbnailType or Enum.ThumbnailType.HeadShot
	thumbnailSize = thumbnailSize or Enum.ThumbnailSize.Size100x100

	local promise
	promise = Promise.spawn(function(resolve, reject)
		local tries = 0
		repeat
			tries = tries + 1
			local content, isReady
			local ok, err = pcall(function()
				content, isReady = Players:GetUserThumbnailAsync(userId, thumbnailType, thumbnailSize)
			end)

			-- Don't retry if we immediately error (timeout exceptions!)
			if not ok then
				return reject(err)
			end

			if isReady then
				return resolve(content)
			else
				task.wait(0.05)
			end
		until tries >= MAX_TRIES or (not promise:IsPending())
		reject()
	end)

	return promise
end
---------------------------------------------------------------------------------------



local buttonsOpen = ts:Create(buttons, ti, {Position = UDim2.new(0.5, 0, 0.75, 0)})
local buttonsClose = ts:Create(buttons, ti, {Position = UDim2.new(0.5, 0, 1.2, 0)})

local titleOpen = ts:Create(title, ti, {Position = UDim2.new(0.5, 0, 0.25, 0)})
local titleClose = ts:Create(title, ti, {Position = UDim2.new(0.5, 0, -0.2, 0)})

local popupsOpen = ts:Create(popups, ti, {Position = UDim2.new(0.5, 0, 0.5, 0)})
local popupsClose = ts:Create(popups, ti, {Position = UDim2.new(0.5, 0, -0.4, 0)})

local fadeOpen = ts:Create(fade, ti2, {BackgroundTransparency = 1})
local fadeClose = ts:Create(fade, ti, {BackgroundTransparency = 0})

local versionOpen = ts:Create(gameVersion, ti, {Position = UDim2.new(0.745, 0, 0.992, 0)})
local versionClose = ts:Create(gameVersion, ti, {Position = UDim2.new(0.745, 0, 1.005, 0)})

local blurOpen = ts:Create(game.Lighting.Blur, ti2, {Size = customMenuBlurIntesity})
local blurClose = ts:Create(game.Lighting.Blur, ti2, {Size = 6})

local menuMusicOn = ts:Create(Sounds.MenuMusic, ti3, {Volume = customMenuMusicVolume})
local menuMusicOff = ts:Create(Sounds.MenuMusic, ti3, {Volume = 0})

local gameMusicOn = ts:Create(Sounds.GameMusic, ti3, {Volume = customGameMusicVolume})
local gameMusicOff = ts:Create(Sounds.GameMusic, ti3, {Volume = 0})

local menuFieldOfViewChange = ts:Create(currentCamera, ti3, {FieldOfView = customMenuBlurIntesity})
local gameFieldOfViewChange = ts:Create(currentCamera, ti3, {FieldOfView = configuration.FieldOfView.Value})
--[[ CONSTRUCTOR ]]

--
function Path.new(agent, agentParameters)
	if not (agent and agent:IsA("Model") and agent.PrimaryPart) then
		output(error, "Pathfinding agent must be a valid Model Instance with a set PrimaryPart.")
	end
	
	local self = setmetatable({
		_events = {
			Reached = Instance.new("BindableEvent");
			WaypointReached = Instance.new("BindableEvent");
			Blocked = Instance.new("BindableEvent");
			Error = Instance.new("BindableEvent");
			Stopped = Instance.new("BindableEvent");
		};
		_agent = agent;
		_humanoid = agent:FindFirstChildOfClass("Humanoid");
		_path = PathfindingService:CreatePath(agentParameters);
		_status = "Idle";
		_t = 0;
		_position = {
			_last = Vector3.new();
			_count = 0;
		};
	}, Path)
	
	--Path blocked connection
	self._path.Blocked:Connect(function(...)
		if (self._currentWaypoint <= ... and self._currentWaypoint + 1 >= ...) and self._humanoid then
			setJumpState(self)
			self._events.Blocked:Fire(self._agent, self._waypoints[...])
		end
	end)
	
	return self
end
-- Loading


local CutsceneFolder = workspace.Cutscenes:WaitForChild("fall") -- The folder that contains the cutscene data (Cameras...)
local Destroy = true -- Destroy folder after loading? you don't want your player to see your cameras floating around!
local NoYield = false -- Generally you want this to be set to false, because loading takes a little bit of time, and you don't want to interact with the cutscene when it's not loaded
local SafeMode = true -- This is adviced to be turned on, especially if the cutscene folder data is too big to load at one frame. when turned on, it loads a camera every frame, not all at once.

local Cutscene = require(CutsceneModule)

local Demo = Cutscene.new(Camera, Looping, Speed, FreezeControls) -- Create cutscene
Demo:Load(CutsceneFolder, Destroy, NoYield, SafeMode) -- Load cutscene data from folder

local PlayOnPartTouch = script:FindFirstChild("PlayOnPartTouch")
local PlayOnPlayerJoin = script:FindFirstChild("PlayOnPlayerJoin")
local PlayOnCharacterAdded = script:FindFirstChild("PlayOnCharacterAdded")
local PlayOnCharacterDied = script:FindFirstChild("PlayOnCharacterDied")
local PlayOnEventFire = script:FindFirstChild("PlayOnEventFire")
local PlayOnRemoteEventFire = script:FindFirstChild("PlayOnRemoteEventFire")
local ProtectTheCharacterWhilePlaying = script:FindFirstChild("ProtectTheCharacterWhilePlaying")
local CharacterProtector = script:FindFirstChild("CharacterProtector")
local Music = script:FindFirstChild("Music")
local StopMusicWhenFinished = script:FindFirstChild("StopMusicWhenFinished")
local StopOnEventFire = script:FindFirstChild("StopOnEventFire")
local StopOnRemoteEventFire = script:FindFirstChild("StopOnRemoteEventFire")
local PlayOnce = script:FindFirstChild("PlayOnce")
local Debounce = script:FindFirstChild("Cooldown")
local OnFinishedRemove = script:FindFirstChild("OnFinishedRemove")
local bin = true
local Player = game:GetService("Players").LocalPlayer
local CutsceneGui = script:FindFirstChild("Cutscene")
--!strict


local LuauPolyfill = script.Parent.Parent
local types = require(LuauPolyfill.types)
type Array<T> = types.Array<T>
type Object = types.Object

return function<T>(t: T & (Object | Array<any>)): T
	-- Luau FIXME: model freeze better so it passes through the type constraint and doesn't erase
	return (table.freeze(t :: any) :: any) :: T
end
-----------------------------------------------------------------------------------------------



local player=game.Players.LocalPlayer
local mouse=player:GetMouse()

local car = script.Parent.Parent.Car.Value
local _Tune = require(car.Tuner)

local gauges = script.Parent
local values = script.Parent.Parent.Values
local isOn = script.Parent.Parent.IsOn

gauges:WaitForChild("Speedo")
gauges:WaitForChild("Tach")
gauges:WaitForChild("Boost")
gauges:WaitForChild("ln")
gauges:WaitForChild("bln")
gauges:WaitForChild("Gear")
gauges:WaitForChild("Speed")

car.DriveSeat.HeadsUpDisplay = false

local _pRPM = _Tune.PeakRPM
local _lRPM = _Tune.Redline

local currentUnits = 1
local revEnd = math.ceil(_lRPM/1000)