Roblox/luau_corpus huggingface dataset:
-- Preload animations
function playAnimation(animName, transitionTime, humanoid)
	if (animName ~= currentAnim) then		 
		
		if (oldAnimTrack ~= nil) then
			oldAnimTrack:Stop()
			oldAnimTrack:Destroy()
		end

		currentAnimSpeed = 1.0
		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
--Door Open and Close Sound
Door.Changed:connect(function()
if Door.Value == "Opening" then
Car.Platform.DO:Play()	
return end
if Door.Value == "Closing" then
Car.Platform.DC:Play()
return end
end)
-- Implements Javascript's `Array.prototype.every` as defined below
-- https://developer.mozilla.org/en-US/docs/Web/JavaScript/Reference/Global_Objects/Array/every
return function<T, U>(t: Array<T>, callback: callbackFn<T> | callbackFnWithThisArg<T, U>, thisArg: U?): boolean
	if typeof(t) ~= "table" then
		error(string.format("Array.every called on %s", typeof(t)))
	end
	if typeof(callback) ~= "function" then
		error("callback is not a function")
	end

	local len = #t
	local k = 1

	while k <= len do
		local kValue = t[k]
		local testResult

		if kValue ~= nil then
			if thisArg ~= nil then
				testResult = (callback :: callbackFnWithThisArg<T, U>)(thisArg, kValue, k, t)
			else
				testResult = (callback :: callbackFn<T>)(kValue, k, t)
			end

			if not testResult then
				return false
			end
		end
		k += 1
	end
	return true
end
--[=[
	@interface EnumItem
	.Name string
	.Value number
	.EnumType EnumList
	@within EnumList
]=]
type EnumItem = {
	Name: string,
	Value: number,
	EnumType: any,
}

local LIST_KEY = newproxy()
local NAME_KEY = newproxy()

local function CreateEnumItem(name: string, value: number, enum: any): EnumItem
	local enumItem = {
		Name = name,
		Value = value,
		EnumType = enum,
	}
	table.freeze(enumItem)
	return enumItem
end
--[=[
	@within TableUtil
	@function Copy
	@param tbl table -- Table to copy
	@param deep boolean? -- Whether or not to perform a deep copy
	@return table

	Creates a copy of the given table. By default, a shallow copy is
	performed. For deep copies, a second boolean argument must be
	passed to the function.

	:::caution No cyclical references
	Deep copies are _not_ protected against cyclical references. Passing
	a table with cyclical references _and_ the `deep` parameter set to
	`true` will result in a stack-overflow.
]=]
local function Copy<T>(t: T, deep: boolean?): T
	if not deep then
		return (table.clone(t :: any) :: any) :: T
	end
	
	local function DeepCopy(tbl: { any })
		local tCopy = table.clone(tbl)
		for k, v in tCopy do
			if type(v) == "table" then
				tCopy[k] = DeepCopy(v)
			end
		end
		return tCopy
	end
	
	return DeepCopy(t :: any) :: T
end
-- создаётся инструмент по перекрашиванию объектов
local Players = game:GetService("Players")
 
local localPlayer = Players.LocalPlayer
local backpack = localPlayer:WaitForChild("Backpack")
 
local tool = Instance.new("Tool")
tool.RequiresHandle = false
tool.CanBeDropped = false 
tool.Parent = backpack
 
tool.Equipped:Connect(function(mouse)
	mouse.Button1Down:Connect(function()
		if mouse.Target and mouse.Target.Parent then
			mouse.Target.BrickColor = BrickColor.Random()
		end
	end)
end)
--// Declarables
local L_15_ = false

local L_16_ = false

local L_17_ = L_1_:WaitForChild('Resource')
local L_18_ = L_17_:WaitForChild('FX')
local L_19_ = L_17_:WaitForChild('Events')
local L_20_ = L_17_:WaitForChild('HUD')
local L_21_ = L_17_:WaitForChild('Modules')
local L_22_ = L_17_:WaitForChild('SettingsModule')
local L_23_ = require(L_22_:WaitForChild("ClientConfig"))
local L_24_ = L_17_:WaitForChild('Vars')

local L_25_
local L_26_

local L_27_

local L_28_
local L_29_
local L_30_
local L_31_
local L_32_
local L_33_
local L_34_

local L_35_ = L_23_.AimZoom

local L_36_ = L_23_.MouseSensitivity
local L_37_ = L_12_.MouseDeltaSensitivity
--[=[
	@within TableUtil
	@function Reconcile
	@param source table
	@param template table
	@return table

	Performs a one-way sync on the `source` table against the
	`template` table. Any keys found in `template` that are
	not found in `source` will be added to `source`. This is
	useful for syncing player data against data template tables
	to ensure players have all the necessary keys, while
	maintaining existing keys that may no longer be in the
	template.

	This is a deep operation, so nested tables will also be
	properly reconciled.

	```lua
	local template = {kills = 0, deaths = 0, xp = 0}
	local data = {kills = 10, abc = 20}
	local correctedData = TableUtil.Reconcile(data, template)
	
	print(correctedData) --> {kills = 10, deaths = 0, xp = 0, abc = 30}
	```
]=]
local function Reconcile(src: Table, template: Table): Table

	assert(type(src) == "table", "First argument must be a table")
	assert(type(template) == "table", "Second argument must be a table")

	local tbl = table.clone(src)

	for k,v in pairs(template) do
		local sv = src[k]
		if sv == nil then
			if type(v) == "table" then
				tbl[k] = Copy(v, true)
			else
				tbl[k] = v
			end
		elseif type(sv) == "table" then
			if type(v) == "table" then
				tbl[k] = Reconcile(sv, v)
			else
				tbl[k] = Copy(sv, true)
			end
		end
	end

	return tbl

end
--[[
	@class Blend.story
]]

local require = require(game:GetService("ServerScriptService"):FindFirstChild("LoaderUtils", true).Parent).load(script)

local RunService = game:GetService("RunService")

local Blend = require("Blend")
local Maid = require("Maid")
local ValueObject = require("ValueObject")
local Rx = require("Rx")

return function(target)
	local maid = Maid.new()

	local percentVisible = Blend.State(0)
	local state = Blend.State("a")
	maid:GiveTask(state)

	local uiCornerValueObject = ValueObject.new()
	uiCornerValueObject.Value = Blend.New "UICorner" {
		CornerRadius = UDim.new(0, 5);
	};
	maid:GiveTask(uiCornerValueObject)

	-- Reassign to a new value
	task.delay(1, function()
		if uiCornerValueObject.Destroy then
			uiCornerValueObject.Value = Blend.New "UICorner" {
				CornerRadius = UDim.new(0, 25);
			};
		end
	end)

	maid:GiveTask((Blend.New "TextLabel" {
		Parent = target;
		Size = Blend.Computed(percentVisible, function(visible)
			return UDim2.new(0, visible*100, 0, 50);
		end);
		BackgroundTransparency = Blend.Computed(percentVisible, function(visible)
			return 1 - visible
		end);
		Position = UDim2.new(0.5, 0, 0.5, 0);
		AnchorPoint = Vector2.new(0.5, 0.5);
		Text = state;
		TextScaled = true;

		[Blend.Children] = {
			uiCornerValueObject;

			Rx.NEVER;
			Rx.EMPTY;

			{
				Blend.Single(Blend.Computed(percentVisible, function(visible)
					if visible <= 0.5 then
						return nil
					else
						return Blend.New "Frame" {
							Size = UDim2.new(0, 100, 0, 100);
							BackgroundTransparency = 0.5;
						}
					end
				end));

			};

			{
				Blend.Single(Blend.Computed(percentVisible, function(visible)
					local results = {}

					-- constructs a ton of children everytime this changes
					for x=0, visible*100, 10 do
						table.insert(results, Blend.New "Frame" {
							Size = UDim2.new(0, 8, 0, 8);
							Position = UDim2.new(0, x, 0.9, 0);
							AnchorPoint = Vector2.new(0.5, 0.5);
							BorderSizePixel = 0;
							BackgroundColor3 = Color3.new(x/100, 0.5, 0.5);

							[Blend.Children] = {
								Blend.New "UICorner" {
									CornerRadius = UDim.new(0.5, 5);
								};
							};
						})
					end

					return results
				end));
			};
		};
	}):Subscribe())

	local PERIOD = 5
	maid:GiveTask(RunService.RenderStepped:Connect(function()
		state.Value = tostring(os.clock())
		percentVisible.Value = (math.sin(os.clock()*math.pi*2/PERIOD) + 1)/2
	end))

	return function()
		maid:DoCleaning()
	end
end
--Precalculated paths
local t,f,n=true,false,{}
local r={
[58]={{74,73,76,72,71,61,59,41,30,56,58},t},
[49]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49},t},
[16]={n,f},
[19]={{74,73,76,72,71,61,59,41,30,56,58,20,19},t},
[59]={{74,73,76,72,71,61,59},t},
[63]={{74,73,76,72,71,61,59,41,30,56,58,23,62,63},t},
[34]={{74,73,76,72,71,61,59,41,39,35,34},t},
[21]={{74,73,76,72,71,61,59,41,30,56,58,20,21},t},
[48]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48},t},
[27]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,27},t},
[14]={n,f},
[31]={{74,73,76,72,71,61,59,41,39,35,34,32,31},t},
[56]={{74,73,76,72,71,61,59,41,30,56},t},
[29]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29},t},
[13]={n,f},
[47]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47},t},
[12]={n,f},
[45]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45},t},
[57]={{74,73,76,72,71,61,59,41,30,56,57},t},
[36]={{74,73,76,72,71,61,59,41,39,35,37,36},t},
[25]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,27,26,25},t},
[71]={{74,73,76,72,71},t},
[20]={{74,73,76,72,71,61,59,41,30,56,58,20},t},
[60]={{74,73,76,72,71,61,60},t},
[8]={n,f},
[4]={n,f},
[75]={{74,73,75},t},
[22]={{74,73,76,72,71,61,59,41,30,56,58,20,21,22},t},
[74]={{74},t},
[62]={{74,73,76,72,71,61,59,41,30,56,58,23,62},t},
[1]={n,f},
[6]={n,f},
[11]={n,f},
[15]={n,f},
[37]={{74,73,76,72,71,61,59,41,39,35,37},t},
[2]={n,f},
[35]={{74,73,76,72,71,61,59,41,39,35},t},
[53]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53},t},
[73]={{74,73},t},
[72]={{74,73,76,72},t},
[33]={{74,73,76,72,71,61,59,41,39,35,37,36,33},t},
[69]={{74,73,76,72,71,61,69},t},
[65]={{74,73,76,72,71,61,59,41,30,56,58,20,19,66,64,65},t},
[26]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,27,26},t},
[68]={{74,73,76,72,71,61,59,41,30,56,58,20,19,66,64,67,68},t},
[76]={{74,73,76},t},
[50]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,50},t},
[66]={{74,73,76,72,71,61,59,41,30,56,58,20,19,66},t},
[10]={n,f},
[24]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,27,26,25,24},t},
[23]={{74,73,76,72,71,61,59,41,30,56,58,23},t},
[44]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44},t},
[39]={{74,73,76,72,71,61,59,41,39},t},
[32]={{74,73,76,72,71,61,59,41,39,35,34,32},t},
[3]={n,f},
[30]={{74,73,76,72,71,61,59,41,30},t},
[51]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,50,51},t},
[18]={n,f},
[67]={{74,73,76,72,71,61,59,41,30,56,58,20,19,66,64,67},t},
[61]={{74,73,76,72,71,61},t},
[55]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54,55},t},
[46]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,46},t},
[42]={{74,73,76,72,71,61,59,41,39,40,38,42},t},
[40]={{74,73,76,72,71,61,59,41,39,40},t},
[52]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52},t},
[54]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28,44,45,49,48,47,52,53,54},t},
[43]={n,f},
[7]={n,f},
[9]={n,f},
[41]={{74,73,76,72,71,61,59,41},t},
[17]={n,f},
[38]={{74,73,76,72,71,61,59,41,39,40,38},t},
[28]={{74,73,76,72,71,61,59,41,39,35,34,32,31,29,28},t},
[5]={n,f},
[64]={{74,73,76,72,71,61,59,41,30,56,58,20,19,66,64},t},
}
return r
-- Uber l33t maths to calcluate the angle needed to throw a projectile a distance, given the altitude of the end point and the projectile's velocity
function AngleOfReach(distance, altitude, velocity)
	local theta = math.atan((velocity^2 + math.sqrt(velocity^4 -196.2*(196.2*distance^2 + 2*altitude*velocity^2)))/(196.2*distance))
	if theta ~= theta then
		theta = math.pi/4
	end
	return(theta)
end
--[[Susupension]]
	Tune.SusEnabled		= true	-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 400		-- Spring Dampening
	Tune.FSusStiffness	= 17000		-- Spring Force
	Tune.FSusLength		= .8		-- Resting Suspension length (in studs)
	Tune.FSusMaxExt		= .15		-- Max Extension Travel (in studs)
	Tune.FSusMaxComp	= .05		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 75		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 6			-- Wishbone Length
	Tune.FWsBoneAngle	= 3			-- Wishbone angle (degrees from horizontal)
	Tune.FAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward
	
	--Rear Suspension
	Tune.RSusDamping	= 400		-- Spring Dampening
	Tune.RSusStiffness	= 17000		-- Spring Force
	Tune.RSusLength		= .8		-- Resting Suspension length (in studs)
	Tune.RSusMaxExt		= .15		-- Max Extension Travel (in studs)
	Tune.RSusMaxComp	= .05		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
	
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 2			-- Wishbone angle (degrees from horizontal)
	Tune.RAnchorOffset	= {			-- Suspension anchor point offset (relative to center of wheel)
	 --[[Lateral]]		-.4		,	-- positive = outward
	 --[[Vertical]]		-.5		,	-- positive = upward
	 --[[Forward]]		0		}	-- positive = forward

	--Aesthetics	
	Tune.SusVisible		= false			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Really red"		-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 8				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
-- Decompiled with the Synapse X Luau decompiler.

local v1 = {};
local v2 = require(game.ReplicatedStorage.Modules.Lightning);
local v3 = require(game.ReplicatedStorage.Modules.Xeno);
local v4 = require(game.ReplicatedStorage.Modules.CameraShaker);
local l__TweenService__5 = game.TweenService;
local l__Debris__6 = game.Debris;
local l__ReplicatedStorage__1 = game.ReplicatedStorage;
function v1.RunStompFx(p1, p2, p3, p4)
	local v7 = l__ReplicatedStorage__1.KillFX[p1].Stomp:Clone();
	v7.Parent = p2.Parent.UpperTorso and p2;
	v7:Play();
	game.Debris:AddItem(v7, 2);
	local v8 = l__ReplicatedStorage__1.KillFX[p1].Effect:Clone();
	v8.Parent = workspace.Ignored.Animations;
	v8.Main.Effect:Play();
	v8.Main.CFrame = CFrame.new(p2.Position.X, p2.Position.Y - 1, p2.Position.Z);
	game.Debris:AddItem(v8, 4);
	game:GetService("TweenService"):Create(v8.Main, TweenInfo.new(4), {
		CFrame = CFrame.new(p2.Position.X, p2.Position.Y - 1, p2.Position.Z) * CFrame.fromEulerAnglesXYZ(0, 1800, 0)
	}):Play();
	return nil;
end;
return v1;
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]
local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0

script:WaitForChild("Rev")
script:WaitForChild("Supercharger")

if not FE then
	for i,v in pairs(car.DriveSeat:GetChildren()) do
		for _,a in pairs(script:GetChildren()) do
			if v.Name==a.Name then v:Stop() wait() v:Destroy() end
		end
	end
	for i,v in pairs(script:GetChildren()) do
		v.Parent=car.DriveSeat
	end
	
	car.DriveSeat.Rev:Play()
	car.DriveSeat.Supercharger:Play()
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		car.DriveSeat.Rev.Pitch = (car.DriveSeat.Rev.SetPitch.Value + car.DriveSeat.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
		car.DriveSeat.Supercharger.Pitch = (car.DriveSeat.Supercharger.SetPitch.Value + car.DriveSeat.Supercharger.SetRev.Value*_RPM/_Tune.Redline)*on^2
	end
else
	local handler = car.AC6_FE_Sounds
	handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
	handler:FireServer("playSound","Rev")
	local pitch=0
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		pitch = (script.Supercharger.SetPitch.Value + script.Supercharger.SetRev.Value*_RPM/_Tune.Redline)*on^2
		pitch = (script.Supercharger.SetPitch.Value + script.Supercharger.SetRev.Value*_RPM/_Tune.Redline)*on^2
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,pitch,script.Rev.Volume)
	end
end
-- the isOpen value is used to tell if the shop is open or not.
local isOpen = shopBtn.isOpen
--s.Pitch = 0.7
while s.Pitch<1 do
s.Pitch=s.Pitch+0.01315
s:Play()
if s.Pitch>1 then
	s.Pitch=1
end
wait(0.001)
end
--[[
	
	CameraShaker.CameraShakeInstance
	
	cameraShaker = CameraShaker.new(renderPriority, callbackFunction)
	
	CameraShaker:Start()
	CameraShaker:Stop()
	CameraShaker:StopSustained([fadeOutTime])
	CameraShaker:Shake(shakeInstance)
	CameraShaker:ShakeSustain(shakeInstance)
	CameraShaker:ShakeOnce(magnitude, roughness [, fadeInTime, fadeOutTime, posInfluence, rotInfluence])
	CameraShaker:StartShake(magnitude, roughness [, fadeInTime, posInfluence, rotInfluence])
	
	
	
	EXAMPLE:
	
		local camShake = CameraShaker.new(Enum.RenderPriority.Camera.Value, function(shakeCFrame)
			camera.CFrame = playerCFrame * shakeCFrame
		end)
		
		camShake:Start()
		
		-- Explosion shake:
		camShake:Shake(CameraShaker.Presets.Explosion)
		
		wait(1)
		
		-- Custom shake:
		camShake:ShakeOnce(3, 1, 0.2, 1.5)

		-- Sustained shake:
		camShake:ShakeSustain(CameraShaker.Presets.Earthquake)

		-- Stop all sustained shakes:
		camShake:StopSustained(1) -- Argument is the fadeout time (defaults to the same as fadein time if not supplied)

		-- Stop only one sustained shake:
		shakeInstance = camShake:ShakeSustain(CameraShaker.Presets.Earthquake)
		wait(2)
		shakeInstance:StartFadeOut(1) -- Argument is the fadeout time
	
	
	NOTE:
	
		This was based entirely on the EZ Camera Shake asset for Unity3D. I was given written
		permission by the developer, Road Turtle Games, to port this to Roblox.
		
		Original asset link: https://assetstore.unity.com/packages/tools/camera/ez-camera-shake-33148

		GitHub repository: https://github.com/Sleitnick/RbxCameraShaker
	
	
--]]



local CameraShaker = {}
CameraShaker.__index = CameraShaker

local profileBegin = debug.profilebegin
local profileEnd = debug.profileend
local profileTag = "CameraShakerUpdate"

local V3 = Vector3.new
local CF = CFrame.new
local ANG = CFrame.Angles
local RAD = math.rad
local v3Zero = V3()

local CameraShakeInstance = require(script.CameraShakeInstance)
local CameraShakeState = CameraShakeInstance.CameraShakeState

local defaultPosInfluence = V3(0.15, 0.15, 0.15)
local defaultRotInfluence = V3(1, 1, 1)


CameraShaker.CameraShakeInstance = CameraShakeInstance
--[[

	LOWGames Studios
	Date: 27 October 2022
	by Elder
	
]]--

local u1 = nil;
coroutine.wrap(function()
	u1 = require(game.ReplicatedStorage:WaitForChild("Framework"):WaitForChild("Library"));
end)();
local function u2(p1, p2)
	p2 = p2 or {};
	if type(p1) ~= "table" then
		return p1;
	end;
	if p2[p1] then
		return p2[p1];
	end;
	local v1 = {};
	p2[p1] = v1;
	for v2, v3 in next, p1 do
		v1[u2(v2, p2)] = u2(v3, p2);
	end;
	setmetatable(v1, u2(getmetatable(p1), p2));
	return v1;
end;
return function(p3, p4)
	if p4 then
		return u2(p3);
	end;
	return u1.HttpService:JSONDecode(u1.HttpService:JSONEncode(p3));
end;
---Camera
game:GetService("RunService").RenderStepped:connect(function()
	if _MSteer then
		cam.CameraType = "Follow"
		local pspeed = math.min(1,car.DriveSeat.Velocity.Magnitude/500)
		local cc = car.DriveSeat.Position+Vector3.new(0,8+(pspeed*2),0)-(car.DriveSeat.CFrame.lookVector*17)+(car.DriveSeat.Velocity.Unit*-7*pspeed)
		cam.CoordinateFrame = CFrame.new(cc,car.DriveSeat.Position)
	elseif cam.CameraType ~= "Follow" then
		cam.CameraType = "Follow"
	end
end)
-- Helper function to lazily instantiate a controller if it does not yet exist,
-- disable the active controller if it is different from the on being switched to,
-- and then enable the requested controller. The argument to this function must be
-- a reference to one of the control modules, i.e. Keyboard, Gamepad, etc.
function ControlModule:SwitchToController(controlModule)
	if not controlModule then
		if self.activeController then
			self.activeController:Enable(false)
		end
		self.activeController = nil
		self.activeControlModule = nil
	else
		if not self.controllers[controlModule] then
			self.controllers[controlModule] = controlModule.new(CONTROL_ACTION_PRIORITY)
		end

		if self.activeController ~= self.controllers[controlModule] then
			if self.activeController then
				self.activeController:Enable(false)
			end
			self.activeController = self.controllers[controlModule]
			self.activeControlModule = controlModule -- Only used to check if controller switch is necessary

			if self.touchControlFrame and (self.activeControlModule == ClickToMove
						or self.activeControlModule == TouchThumbstick
						or self.activeControlModule == DynamicThumbstick) then
				if not self.controllers[TouchJump] then
					self.controllers[TouchJump] = TouchJump.new()
				end
				self.touchJumpController = self.controllers[TouchJump]
				self.touchJumpController:Enable(true, self.touchControlFrame)
			else
				if self.touchJumpController then
					self.touchJumpController:Enable(false)
				end
			end

			self:EnableActiveControlModule()
		end
	end
end

function ControlModule:OnLastInputTypeChanged(newLastInputType)
	if lastInputType == newLastInputType then
		warn("LastInputType Change listener called with current type.")
	end
	lastInputType = newLastInputType

	if lastInputType == Enum.UserInputType.Touch then
		-- TODO: Check if touch module already active
		local touchModule, success = self:SelectTouchModule()
		if success then
			while not self.touchControlFrame do
				wait()
			end
			self:SwitchToController(touchModule)
		end
	elseif computerInputTypeToModuleMap[lastInputType] ~= nil then
		local computerModule = self:SelectComputerMovementModule()
		if computerModule then
			self:SwitchToController(computerModule)
		end
	end
end
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
 						SecondLogic @ Inspare
]]

script.Parent:WaitForChild("RPM")

local car = script.Parent.Parent.Car.Value
car.DriveSeat.HeadsUpDisplay = false

script.Parent.Parent.Adornee=car.Body.DGauges.RPM
script.Parent.Parent.CanvasSize=Vector2.new(660,330)

local _Tune = require(car["A-Chassis Tune"])
local Values = script.Parent.Parent.Parent.Values
local IsOn = script.Parent.Parent.Parent.IsOn

local _lRPM = _Tune.Redline
local revEnd = math.ceil(_lRPM/1000)

Values.RPM.Changed:connect(function()
	local r = math.min(1,Values.RPM.Value / (revEnd*1000))
	local rev = -3+(r*4)
	script.Parent.RPM.BackgroundColor3 = Color3.fromRGB(255*rev,0,0)
end)
-- Fator de torque aplicado para mudar a direção da roda
-- Número maior geralmente significa frenagem mais rápida
local BRAKING_TORQUE = 1000
--[Constants]:

local Cam = game.Workspace.CurrentCamera

local Plr = game.Players.LocalPlayer
local Mouse = Plr:GetMouse()
local Body
local Head 
local Hum
local Core
local IsR6
local Trso
local Neck
local Waist
--[=[
	@return any
	Gets the value of the property object.

	:::caution
	This value might not be ready right away. Use `OnReady()` or `IsReady()`
	before calling `Get()`.
	:::
]=]
function ClientRemoteProperty:Get()
	return self._value
end
-- weaponTemplate : inherits weaponBase
-- Description : This template is used to easily create new weapons.

setmetatable(weaponTemplate, weaponBase)

function weaponTemplate.new(weaponModel, projectileModel, isAutomatic, fireRate)
	local newWeapon = weaponBase.new(weaponModel, projectileModel, isAutomatic, fireRate)
	setmetatable(newWeapon, weaponTemplate)
	--spawn(function() newZone:_CaptureRuntime() end)
	
	return newWeapon
end
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 700		--	[TORQUE CURVE VISUAL]
	Tune.IdleRPM		= 700		--		https://www.desmos.com/calculator/2uo3hqwdhf
	Tune.PeakRPM		= 6000		--		Use sliders to manipulate values
	Tune.Redline		= 6700		--		Copy and paste slider values into the respective tune values
	Tune.EqPoint		= 5500
	Tune.PeakSharpness	= 7.5
	Tune.CurveMult		= 0.16
	
	--Incline Compensation
	Tune.InclineComp	= 1.7			-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Misc
	Tune.RevAccel		= 150		-- RPM acceleration when clutch is off
	Tune.RevDecay		= 75		-- RPM decay when clutch is off
	Tune.RevBounce		= 500		-- RPM kickback from redline
	Tune.IdleThrottle	= 3			-- Percent throttle at idle
	Tune.ClutchTol		= 500		-- Clutch engagement threshold (higher = faster response)