Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- loop through all the arm parts and make them visible in first person


local function visiblearms(bool)
	if armsvisible then
		local castshadow = not bool
		for i, part in ipairs(armparts) do
			part.LocalTransparencyModifier = armtransparency
			part.CanCollide = false
			part.CastShadow = castshadow
		end
	end
end
-- Setup animation objects


function scriptChildModified(child)
	local fileList = animNames[child.Name]
	if (fileList ~= nil) then
		configureAnimationSet(child.Name, fileList)
	end	
end

script.ChildAdded:connect(scriptChildModified)
script.ChildRemoved:connect(scriptChildModified)


for name, fileList in pairs(animNames) do 
	configureAnimationSet(name, fileList)
end
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleTCS				= Enum.KeyCode.KeypadEquals					,
		ToggleABS				= Enum.KeyCode.KeypadZero					,
		ToggleTransMode			= Enum.KeyCode.KeypadEight					,
		ToggleMouseDrive		= Enum.KeyCode.F1					,
		
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
--[[[Default Controls]]


	--Peripheral Deadzones
	Tune.Peripherals = {
		MSteerWidth				= 67		,	-- Mouse steering control width	(0 - 100% of screen width)
		MSteerDZone				= 10		,	-- Mouse steering deadzone (0 - 100%)
		
		ControlLDZone			= 5			,	-- Controller steering L-deadzone (0 - 100%)
		ControlRDZone			= 5			,	-- Controller steering R-deadzone (0 - 100%)
	}
	
	--Control Mapping
	Tune.Controls = {
		
	--Keyboard Controls
		--Mode Toggles
		ToggleABS				= Enum.KeyCode.Y					,
		ToggleTransMode			= Enum.KeyCode.M					,
		--Primary Controls
		Throttle				= Enum.KeyCode.Up					,
		Brake					= Enum.KeyCode.Down					,
		SteerLeft				= Enum.KeyCode.Left					,
		SteerRight				= Enum.KeyCode.Right				,
		
		--Secondary Controls
		Throttle2				= Enum.KeyCode.W					,
		Brake2					= Enum.KeyCode.S					,
		SteerLeft2				= Enum.KeyCode.A					,
		SteerRight2				= Enum.KeyCode.D					,
		
		--Manual Transmission
		ShiftUp					= Enum.KeyCode.E					,
		ShiftDown				= Enum.KeyCode.Q					,
		Clutch					= Enum.KeyCode.LeftShift			,
		
		--Handbrake
		PBrake					= Enum.KeyCode.P					,
		
	--Mouse Controls
		MouseThrottle			= Enum.UserInputType.MouseButton1	,
		MouseBrake				= Enum.UserInputType.MouseButton2	,
		MouseClutch				= Enum.KeyCode.W					,
		MouseShiftUp			= Enum.KeyCode.E					,
		MouseShiftDown			= Enum.KeyCode.Q					,
		MousePBrake				= Enum.KeyCode.LeftShift			,
		
	--Controller Mapping
		ContlrThrottle			= Enum.KeyCode.ButtonR2				,
		ContlrBrake				= Enum.KeyCode.ButtonL2				,
		ContlrSteer				= Enum.KeyCode.Thumbstick1			,
		ContlrShiftUp			= Enum.KeyCode.ButtonY				,
		ContlrShiftDown			= Enum.KeyCode.ButtonX				,
		ContlrClutch			= Enum.KeyCode.ButtonR1				,
		ContlrPBrake			= Enum.KeyCode.ButtonL1				,
		ContlrToggleTMode		= Enum.KeyCode.DPadUp				,
		ContlrToggleTCS			= Enum.KeyCode.DPadDown				,
		ContlrToggleABS			= Enum.KeyCode.DPadRight			,
	}
--[[Drivetrain Initialize]]



	local Drive={}
	
	--Power Front Wheels
	if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
		for i,v in pairs(car.Wheels:GetChildren()) do
			if v.Name=="FL" or v.Name=="FR" or v.Name=="F" then
				table.insert(Drive,v)
			end
		end
	end
	
	--Power Rear Wheels
	if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
		for i,v in pairs(car.Wheels:GetChildren()) do
			if v.Name=="RL" or v.Name=="RR" or v.Name=="R" then
				table.insert(Drive,v)
			end
		end
	end
	
	--Determine Wheel Size
	local wDia = 0
	for i,v in pairs(Drive) do
		if v.Size.x>wDia then wDia = v.Size.x end
	end
	
	--Pre-Toggled PBrake
	for i,v in pairs(car.Wheels:GetChildren()) do
		if v["#AV"]:IsA("BodyAngularVelocity") then
			if math.abs(v["#AV"].maxTorque.Magnitude-PBrakeForce)<1 then
				_PBrake=true
			end
		else
			if math.abs(v["#AV"].MotorMaxTorque-PBrakeForce)<1 then
				_PBrake=true
			end
		end
	end
--!strict


local ClientBridge = require(script.ClientBridge)
local ClientIdentifiers = require(script.ClientIdentifiers)
local ClientProcess = require(script.ClientProcess)
local Types = require(script.Parent.Types)

local Client = {}

function Client.start()
	ClientProcess.start()
	ClientIdentifiers.start()
end

function Client.ser(identifierName: Types.Identifier): Types.Identifier?
	return ClientIdentifiers.ser(identifierName)
end

function Client.deser(compressedIdentifier: Types.Identifier): Types.Identifier?
	return ClientIdentifiers.deser(compressedIdentifier)
end

function Client.makeIdentifier(name: string, timeout: number?)
	return ClientIdentifiers.ref(name, timeout)
end

function Client.makeBridge(name: string)
	return ClientBridge(name)
end

return Client
--[[Flip]]



	function Flip()
		--Detect Orientation
		if (car.DriveSeat.CFrame*CFrame.Angles(math.pi/2,0,0)).lookVector.y > .1 or FlipDB then
			FlipWait=tick()
			
		--Apply Flip
		else
			if tick()-FlipWait>=3 then
				FlipDB=true
				local gyro = car.DriveSeat.Flip
				gyro.maxTorque = Vector3.new(10000,0,10000)
				gyro.P=3000
				gyro.D=500
				wait(1)
				gyro.maxTorque = Vector3.new(0,0,0)
				gyro.P=0
				gyro.D=0
				FlipDB=false
			end
		end
	end
--[[Steering]]



local function Steering()
	local SteerLocal = script.Parent.Values.SteerC.Value
	--Mouse Steer
	if _MSteer then
		local msWidth = math.max(1,mouse.ViewSizeX*_Tune.Peripherals.MSteerWidth/200)
		local mdZone = _Tune.Peripherals.MSteerDZone/100
		local mST = ((mouse.X-mouse.ViewSizeX/2)/msWidth)
		if math.abs(mST)<=mdZone then
			_GSteerT = 0
		else
			_GSteerT = (math.max(math.min((math.abs(mST)-mdZone),(1-mdZone)),0)/(1-mdZone))^_Tune.MSteerExp * (mST / math.abs(mST))
		end
	end

	--Interpolate Steering
	if SteerLocal < _GSteerT then
		if SteerLocal<0 then
			SteerLocal = math.min(_GSteerT,SteerLocal+_Tune.ReturnSpeed)
		else
			SteerLocal = math.min(_GSteerT,SteerLocal+_Tune.SteerSpeed)
		end
	else
		if SteerLocal>0 then
			SteerLocal = math.max(_GSteerT,SteerLocal-_Tune.ReturnSpeed)
		else
			SteerLocal = math.max(_GSteerT,SteerLocal-_Tune.SteerSpeed)
		end
	end

	--Steer Decay Multiplier
	local sDecay = (1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-(_Tune.MinSteer/100)))

	--Apply Steering
	for _,v in ipairs(car.Wheels:GetChildren()) do
		if v.Name=="F" then
			v.Arm.Steer.CFrame=car.Wheels.F.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerInner*sDecay),0)
		elseif v.Name=="FL" then
			if SteerLocal>= 0 then
				v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerOuter*sDecay),0)
			else
				v.Arm.Steer.CFrame=car.Wheels.FL.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerInner*sDecay),0)
			end
		elseif v.Name=="FR" then
			if SteerLocal>= 0 then
				v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerInner*sDecay),0)
			else
				v.Arm.Steer.CFrame=car.Wheels.FR.Base.CFrame*CFrame.Angles(0,-math.rad(SteerLocal*_Tune.SteerOuter*sDecay),0)
			end
		end
	end
end
-- Stuff (do not edit below)



local configModel = script.Parent.Config
local scoreBlock = script.Parent.ScoreBlock

local uS = configModel.UploadScore
local rS = configModel.RemoteScore
local lSU = configModel.LocalScoreUpdate

uS.Refresh.Value = SCORE_UPDATE
rS.Score.Value = NAME_OF_STAT
rS.Original.Value = PLAYER_SAVE
rS.DataStore.Value = DATA_STORE
lSU.Refresh.Value = PLAYER_UPDATE

uS.Disabled = false
uS.Parent = game.ServerScriptService

rS.Disabled = false
rS.Parent = game.Workspace

lSU.Disabled = false
lSU.Parent = game.StarterGui
-- tween engine sound volume when we start driving


local engineStartTween = TweenInfo.new(0.25, Enum.EasingStyle.Quad, Enum.EasingDirection.In, 0, false, 0)

local Remotes = Vehicle:WaitForChild("Remotes")
local SetThrottleRemote = Remotes:WaitForChild("SetThrottle")
local SetThrottleConnection = nil

local EngineSoundEnabled = true
local TireTrailEnabled = true

local ignitionTime = 1.75 -- seconds

local lastAvgAngularVelocity = 0
local throttleEnabled = false
local lastThrottleUpdate = 0

local enginePower = 0 -- current rpm of the engine
local gainModifier = 1 -- modifier to engine rpm gain (lower if approaching max speed)
--[[
	A simplistic spring implementation.
]]



local e=2.718281828459045

local function posvel(d,s,p0,v0,p1,v1,x)
	if s==0 then
		return p0
	elseif d<1-1e-8 then
		local h=(1-d*d)^0.5
		local c1=(p0-p1+2*d/s*v1)
		local c2=d/h*(p0-p1)+v0/(h*s)+(2*d*d-1)/(h*s)*v1
		local co=math.cos(h*s*x)
		local si=math.sin(h*s*x)
		local ex=e^(d*s*x)
		return co/ex*c1+si/ex*c2+p1+(x-2*d/s)*v1, s*(co*h-d*si)/ex*c2-s*(co*d+h*si)/ex*c1+v1
	elseif d<1+1e-8 then
		local c1=p0-p1+2/s*v1
		local c2=p0-p1+(v0+v1)/s
		local ex=e^(s*x)
		return (c1+c2*s*x)/ex+p1+(x-2/s)*v1, v1-s/ex*(c1+(s*x-1)*c2)
	else
		local h=(d*d-1)^0.5
		local a=(v1-v0)/(2*s*h)
		local b=d/s*v1-(p1-p0)/2
		local c1=(1-d/h)*b+a
		local c2=(1+d/h)*b-a
		local co=e^(-(h+d)*s*x)
		local si=e^((h-d)*s*x)
		return c1*co+c2*si+p1+(x-2*d/s)*v1, si*(h-d)*s*c2-co*(d+h)*s*c1+v1
	end
end

local function targposvel(p1,v1,x)
	return p1+x*v1,v1
end

local Spring = {}

Spring.__index = Spring
--[[Brakes]]


	Tune.ABSEnabled		= true		-- Implements ABS
	Tune.ABSThreshold	= 20		-- Slip speed allowed before ABS starts working (in SPS) 

	Tune.FBrakeForce	= 1500		-- Front brake force
	Tune.RBrakeForce	= 1000		-- Rear brake force
	Tune.PBrakeForce	= 5000		-- Handbrake force
	
	Tune.FLgcyBForce	= 15000		-- Front brake force [PGS OFF]
	Tune.RLgcyBForce	= 10000		-- Rear brake force [PGS OFF]
	Tune.LgcyPBForce	= 25000		-- Handbrake force [PGS OFF]
-- << CUSTOM >>
-- Theme


local ratio = 6.1/#themeColors
local themeFrame = pages.custom["AB ThemeSelection"]
local themeDe = true
local function updateThemeSelection(themeName, themeColor)
	if themeName == nil then
		for i,v in pairs(themeColors) do
			if v[1] == main.pdata.Theme then
				themeName = v[1]
				themeColor = v[2]
				break
			end
		end
	end
	if themeName then
		local themeFrames = {}
		for a,b in pairs(main.gui:GetDescendants()) do
			if b:IsA("BoolValue") and b.Name == "Theme" then
				table.insert(themeFrames, b.Parent)
			end
		end 
		for _,f in pairs(themeFrames) do
			local newThemeColor = themeColor
			if f.Theme.Value then
				local h,s,v = Color3.toHSV(themeColor)
				newThemeColor = Color3.fromHSV(h, s, v*1.35)
			end
			if f:IsA("TextLabel") then
				local h,s,v = Color3.toHSV(themeColor)
				newThemeColor = Color3.fromHSV(h, s, v*2)
				f.TextColor3 = newThemeColor
			else
				f.BackgroundColor3 = newThemeColor
			end
		end
		for a,b in pairs(themeFrame:GetChildren()) do
			if b:IsA("TextButton") then
				if b.Name == themeName then
					b.BorderSizePixel = 1
				else
					b.BorderSizePixel = 0
				end
			end
		end
	end
end
for i, theme in pairs(themeColors) do
	local themeName = theme[1]
	local themeColor = theme[2]
	local box = themeFrame.ThemeTemplate:Clone()
	box.Name = themeName
	box.UIAspectRatioConstraint.AspectRatio = ratio
	box.BackgroundColor3 = themeColor
	box.MouseButton1Down:Connect(function()
		if themeDe then
			themeDe = false
			main.signals.ChangeSetting:InvokeServer{"Theme", themeName}
			updateThemeSelection(themeName, themeColor)
			themeDe = true
		end
	end)
	box.Visible = true
	box.Parent = themeFrame
end
--------------------------------------------------------------------------------------
--------------------[ GUN SETUP ]-----------------------------------------------------
--------------------------------------------------------------------------------------



serverMain:WaitForChild("Plyr").Value = Player

local gunMomentum = Spring.new(V3())
gunMomentum.s = S.momentumSettings.Speed
gunMomentum.d = S.momentumSettings.Damper

local gunRecoilSpring = Spring.new(V3())
gunRecoilSpring.s = S.recoilSettings.springSpeed
gunRecoilSpring.d = S.recoilSettings.springDamper

local camRecoilSpring = Spring.new(V3())
camRecoilSpring.s = 35
camRecoilSpring.d = 0.5

local crossSpring = Spring.new(V3(crossOffset + (baseSpread + currentSpread) * 50, 0, 0))
crossSpring.s = 20
crossSpring.d = 0.75
--[[
	berezaa's method of saving data (from the dev forum):

	What I do and this might seem a little over-the-top but it's fine as long as you're not using datastores excessively elsewhere is have a datastore and an ordereddatastore for each player. When you perform a save, add a key (can be anything) with the value of os.time() to the ordereddatastore and save a key with the os.time() and the value of the player's data to the regular datastore. Then, when loading data, get the highest number from the ordered data store (most recent save) and load the data with that as a key.

	Ever since I implemented this, pretty much no one has ever lost data. There's no caches to worry about either because you're never overriding any keys. Plus, it has the added benefit of allowing you to restore lost data, since every save doubles as a backup which can be easily found with the ordereddatastore

	edit: while there's no official comment on this, many developers including myself have noticed really bad cache times and issues with using the same datastore keys to save data across multiple places in the same game. With this method, data is almost always instantly accessible immediately after a player teleports, making it useful for multi-place games.
--]]



local DataStoreService = game:GetService("DataStoreService")

local OrderedBackups = {}
OrderedBackups.__index = OrderedBackups

function OrderedBackups:Get()
	local success, value = pcall(function()
		return self.orderedDataStore:GetSortedAsync(false, 1):GetCurrentPage()[1]
	end)

	if not success then
		return false, value
	end

	if value then
		local mostRecentKeyPage = value

		local recentKey = mostRecentKeyPage.value
		self.dataStore2:Debug("most recent key", mostRecentKeyPage)
		self.mostRecentKey = recentKey

		local success, value = pcall(function()
			return self.dataStore:GetAsync(recentKey)
		end)

		if not success then
			return false, value
		end

		return true, value
	else
		self.dataStore2:Debug("no recent key")
		return true, nil
	end
end

function OrderedBackups:Set(value)
	local key = (self.mostRecentKey or 0) + 1

	local success, problem = pcall(function()
		self.dataStore:SetAsync(key, value)
	end)

	if not success then
		return false, problem
	end

	local success, problem = pcall(function()
		self.orderedDataStore:SetAsync(key, key)
	end)

	if not success then
		return false, problem
	end

	self.mostRecentKey = key
	return true
end

function OrderedBackups.new(dataStore2)
	local dataStoreKey = dataStore2.Name .. "/" .. dataStore2.UserId

	local info = {
		dataStore2 = dataStore2,
		dataStore = DataStoreService:GetDataStore(dataStoreKey),
		orderedDataStore = DataStoreService:GetOrderedDataStore(dataStoreKey),
	}

	return setmetatable(info, OrderedBackups)
end

return OrderedBackups
---------------------------------------------------



This = script.Parent
Elevator = This.Parent.Parent.Parent
CustomLabel = require(This.Parent.Parent.Parent.CustomLabel)
Characters = require(script.Characters)

CustomText = CustomLabel["CUSTOMFLOORLABEL"]

Elevator:WaitForChild("Floor").Changed:connect(function(floor)
	--custom indicator code--
	ChangeFloor(tostring(floor))
end)

function ChangeFloor(SF)
	if CustomText[tonumber(SF)] then
		SF = CustomText[tonumber(SF)]
	end
	SetDisplay(1,(string.len(SF) == 2 and SF:sub(1,1) or "NIL"))		
	SetDisplay(2,(string.len(SF) == 2 and SF:sub(2,2) or SF))
end



function SetDisplay(ID,CHAR)
	if This.Display:FindFirstChild("DIG"..ID) and Characters[CHAR] ~= nil then
		for i,l in pairs(Characters[CHAR]) do 
			for r=1,7 do	
				This.Display["DIG"..ID]["D"..r].Color = (l:sub(r,r) == "1" and DisplayColor or DisabledColor)
				This.Display["DIG"..ID]["D"..r].Material = (l:sub(r,r) == "1" and Lit or Unlit)
			end
		end
	end
end
--[[Drivetrain]]

	
	Tune.Config			= "RWD"		--"FWD" , "RWD" , "AWD"
	
	--Differential Settings	
	Tune.FDiffSlipThres	= 50		-- 1 - 100%				(Max threshold of applying full lock determined by deviation from avg speed)
	Tune.FDiffLockThres	= 50		-- 0 - 100%				(0 - Bias toward slower wheel, 100 - Bias toward faster wheel)
	Tune.RDiffSlipThres	= 50		-- 1 - 100%
	Tune.RDiffLockThres	= 50		-- 0 - 100%
	Tune.CDiffSlipThres	= 50		-- 1 - 100%				[AWD Only]
	Tune.CDiffLockThres	= 50		-- 0 - 100%				[AWD Only]
	
	--Traction Control Settings
	Tune.TCSEnabled		= true		-- Implements TCS
	Tune.TCSThreshold	= 20		-- Slip speed allowed before TCS starts working (in SPS)
	Tune.TCSGradient	= 20		-- Slip speed gradient between 0 to max reduction (in SPS)
	Tune.TCSLimit		= 10		-- Minimum amount of torque at max reduction (in percent)
-- initiate



for _, drop in pairs(DROPS:GetChildren()) do
	HandleDrop(drop)
end

local t	= 0

RunService.Stepped:connect(function(_, deltaTime)
	t	= t + deltaTime
	for drop, dropInfo in pairs(drops) do
		local offset	= drop.Position - CAMERA.CFrame.p
		
		if math.abs(offset.X) < UPDATE_RANGE and math.abs(offset.Y) < UPDATE_RANGE and math.abs(offset.Z) < UPDATE_RANGE then
			local localT	= t + (drop.Position.X + drop.Position.Z) * 0.2
			local cframe	= CFrame.new(drop.Position) * CFrame.new(0, math.sin(localT) * 0.2, 0) * CFrame.Angles(0, localT / 4, 0)
			
			for _, info in pairs(dropInfo.Parts) do
				info.Part.CFrame	= cframe * info.Offset
				local offset		= info.Part.Position - CAMERA.CFrame.p
				info.Outline.CFrame	= info.Part.CFrame + offset.Unit * OUTLINE_WIDTH * 2
			end
		end
	end
end)
--[[Steering]]


	Tune.SteerInner		= 58		-- Inner wheel steering angle (in degrees)
	Tune.SteerOuter		= 58		-- Outer wheel steering angle (in degrees)
	Tune.SteerSpeed		= .5		-- Steering increment per tick (in degrees)
	Tune.ReturnSpeed	= .5		-- Steering increment per tick (in degrees)
	Tune.SteerDecay		= 325		-- Speed of gradient cutoff (in SPS)
	Tune.MinSteer		= 10		-- Minimum steering at max steer decay (in percent)
	Tune.MSteerExp		= 1			-- Mouse steering exponential degree
	
	--Steer Gyro Tuning
	Tune.SteerD			= 1000		-- Steering Dampening
	Tune.SteerMaxTorque	= 5000		-- Steering Force
	Tune.SteerP			= 3500		-- Steering Aggressiveness
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi", "Manual"}								--[[
	[Modes]
		"Auto"		: Automatic shifting
		"Semi"		: Clutchless manual shifting, dual clutch transmission
		"Manual"	: Manual shifting with clutch
		
		>Include within brackets
			eg: {"Semi"} or {"Auto", "Manual"}								
		>First mode is default mode													]]
	
	--Automatic Settings
	Tune.AutoShiftMode	= "Speed"												--[[
	[Modes]
		"Speed"		: Shifts based on wheel speed
		"RPM"		: Shifts based on RPM											]]	
	Tune.AutoUpThresh	= -200		--Automatic upshift point 	(relative to peak RPM, positive = Over-rev)
	Tune.AutoDownThresh = 1400		--Automatic downshift point (relative to peak RPM, positive = Under-rev)
	
	--Gear Ratios
	Tune.FinalDrive		= 4.06			-- Gearing determines top speed and wheel torque
	Tune.Ratios			= {				-- Higher ratio = more torque, Lower ratio = higher top speed
		--[[Reverse]]	3.70		,	-- Copy and paste a ratio to add a gear
		--[[Neutral]]	0			,	-- Ratios can also be deleted
		--[[ 1 ]]		3.53		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		2.04		,
		--[[ 3 ]]		1.38		,
		--[[ 4 ]]		1.03		,
		--[[ 5 ]]		0.81		,
		--[[ 6 ]]		0.64		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
--BOV--


script.Parent.Parent.Values.RPM.Changed:connect(function()
	local t = 0
	t = (totalPSI*20)
	BOVact = math.floor(t)
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
	wait(0.1)
	local t2 = 0
	t2 = (totalPSI*20)
	BOVact2 = math.floor(t2)
end)
script.Parent.Parent.Values.RPM.Changed:connect(function()
	if BOVact > BOVact2 then
		if BOV.IsPlaying == false then
			BOV:Play()
			
		end
	end
	if BOVact < BOVact2 then
		if BOV.IsPlaying == true then
			BOV:Stop()
			
		end
	end
end)
-- METHODS


function IconController.setGameTheme(theme)
	IconController.gameTheme = theme
	local icons = IconController.getIcons()
	for _, icon in pairs(icons) do
		icon:setTheme(theme)
	end
end

function IconController.setDisplayOrder(value)
	value = tonumber(value) or TopbarPlusGui.DisplayOrder
	TopbarPlusGui.DisplayOrder = value
end
IconController.setDisplayOrder(10)

function IconController.getIcons()
	local allIcons = {}
	for otherIcon, _ in pairs(topbarIcons) do
		table.insert(allIcons, otherIcon)
	end
	return allIcons
end

function IconController.getIcon(name)
	for otherIcon, _ in pairs(topbarIcons) do
		if otherIcon.name == name then
			return otherIcon
		end
	end
	return false
end

function IconController.disableHealthbar(bool)
	local finalBool = (bool == nil or bool)
	IconController.healthbarDisabled = finalBool
	IconController.healthbarDisabledSignal:Fire(finalBool)
end

function IconController.canShowIconOnTopbar(icon)
	if (icon.enabled == true or icon.accountForWhenDisabled) and icon.presentOnTopbar then
		return true
	end
	return false
end

function IconController.getMenuOffset(icon)
	local alignment = icon:get("alignment")
	local alignmentGap = IconController[alignment.."Gap"]
	local iconSize = icon:get("iconSize") or UDim2.new(0, 32, 0, 32)
	local sizeX = iconSize.X.Offset
	local iconWidthAndGap = (sizeX + alignmentGap)
	local extendLeft = 0
	local extendRight = 0
	local additionalRight = 0
	if icon.menuOpen then
		local menuSize = icon:get("menuSize")
		local menuSizeXOffset = menuSize.X.Offset
		local direction = icon:_getMenuDirection()
		if direction == "right" then
			extendRight += menuSizeXOffset + alignmentGap/6--2
		elseif direction == "left" then
			extendLeft = menuSizeXOffset + 4
			extendRight += alignmentGap/3--4
			additionalRight = menuSizeXOffset
		end
	end
	return extendLeft, extendRight, additionalRight
end
--[[
	
	Returns true if a table/dictionary contains userdata (somewhat deep)
	
	Functions.HasUserdata(
		table, 					<-- |REQ|	Table/dictionary
	)
	
--]]





return function(tbl)
	--- Variables
	local found = false
	
	--- Scan local function
	local function Scan(v)
		--- Already found userdata
		if found then
			return
		end
		
		--- Iterate
		for key, value in pairs(v) do
			--- Already found userdata
			if found then
				return
			end
			
			--- Main check
			if type(value) == "userdata" or type(key) == "userdata" then
				--- Userdata located
				found = true
				return
				
			elseif type(value) == "table" then
				--- Re-iterate
				Scan(value)
			end
		end
	end
	
	--- Scan
	Scan(tbl)
	
	--
	return found
end