Pinkstack/roblox-luau-corpus-text huggingface dataset:
--[[Driving Aids]]

--
Tune.ABS 			= false  		-- Avoids brakes locking up, reducing risk of lowside
Tune.ABSThreshold 	= 30 			-- Slip speed allowed before ABS starts working (in SPS)

Tune.TCS 			= false  		-- Avoids wheelspin, reducing risk of highsides
Tune.TCSThreshold 	= 30 			-- 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)

Tune.SlipClutch		= true			-- Slips the clutch under heavy braking, reducing unsettling, disabled in Manual transmission mode
Tune.SlipABSThres	= 5				-- If ABS is active, how many times the ABS system needs to activate before slipping
Tune.SlipTimeThres	= 0.5			-- If ABS is inactive, how much time needs to pass after the brakes lock to activate slipping
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 20		-- Spring Dampening
	Tune.FSusStiffness	= 2000	-- Spring Force
	Tune.FAntiRoll 		= 5	-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 5		-- Suspension length (in studs)
	Tune.FPreCompress	= 0		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= 30.0		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= 0		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- 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	= 1		-- Spring Dampening
	Tune.RSusStiffness	= 1		-- Spring Force
	Tune.FAntiRoll 		= 0		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 10			-- Suspension length (in studs)
	Tune.RPreCompress	= 0		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- 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		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--[[
* Determine the common suffix of two strings.
* @param {string} text1 First string.
* @param {string} text2 Second string.
* @return {number} The number of characters common to the end of each string.
--]]


local function _diff_commonSuffix(text1: string, text2: string): number
	-- Quick check for common null cases.
	if #text1 == 0 or #text2 == 0 or strbyte(text1, -1) ~= strbyte(text2, -1) then
		return 0
	end
	-- Binary search.
	-- Performance analysis: https://neil.fraser.name/news/2007/10/09/
	local pointermin = 1
	local pointermax = min(#text1, #text2)
	local pointermid = pointermax
	local pointerend = 1
	while pointermin < pointermid do
		if strsub(text1, -pointermid, -pointerend) == strsub(text2, -pointermid, -pointerend) then
			pointermin = pointermid
			pointerend = pointermin
		else
			pointermax = pointermid
		end
		pointermid = floor(pointermin + (pointermax - pointermin) / 2)
	end
	return pointermid
end
-- Dropdowns


local dropdownContainer = Instance.new("Frame")
dropdownContainer.Name = "DropdownContainer"
dropdownContainer.BackgroundTransparency = 1
dropdownContainer.BorderSizePixel = 0
dropdownContainer.AnchorPoint = Vector2.new(0.5, 0)
dropdownContainer.ZIndex = -2
dropdownContainer.ClipsDescendants = true
dropdownContainer.Visible = true
dropdownContainer.Parent = iconContainer
dropdownContainer.Active = false

local dropdownFrame = Instance.new("ScrollingFrame")
dropdownFrame.Name = "DropdownFrame"
dropdownFrame.BackgroundTransparency = 1
dropdownFrame.BorderSizePixel = 0
dropdownFrame.AnchorPoint = Vector2.new(0.5, 0)
dropdownFrame.Position = UDim2.new(0.5, 0, 0, 0)
dropdownFrame.Size = UDim2.new(0.5, 2, 1, 0)
dropdownFrame.ZIndex = -1
dropdownFrame.ClipsDescendants = false
dropdownFrame.Visible = true
dropdownFrame.TopImage = dropdownFrame.MidImage
dropdownFrame.BottomImage = dropdownFrame.MidImage
dropdownFrame.VerticalScrollBarInset = Enum.ScrollBarInset.Always
dropdownFrame.VerticalScrollBarPosition = Enum.VerticalScrollBarPosition.Right
dropdownFrame.Parent = dropdownContainer
dropdownFrame.Active = false

local dropdownList = Instance.new("UIListLayout")
dropdownList.Name = "DropdownList"
dropdownList.FillDirection = Enum.FillDirection.Vertical
dropdownList.SortOrder = Enum.SortOrder.LayoutOrder
dropdownList.Parent = dropdownFrame

local dropdownPadding = Instance.new("UIPadding")
dropdownPadding.Name = "DropdownPadding"
dropdownPadding.PaddingRight = UDim.new(0, 2)
dropdownPadding.Parent = dropdownFrame
--//Variables\\--


local tool = script.Parent
	local handle = tool:WaitForChild("Handle")

local contextActionService = game:GetService("ContextActionService")
	
local player = game.Players.LocalPlayer
	local mouse = player:GetMouse()
	local character = player.Character or player.CharacterAdded:Wait()	
	
local enabled = true
local specialDB = true

local cursorId = "http://www.roblox.com/asset/?id=251497633"
local hitId = "http://www.roblox.com/asset/?id=70785856"

local configs = tool:WaitForChild("Configurations")
	local fireRate = configs:FindFirstChild("FireRate")
	local specialRechargeTime = configs:FindFirstChild("SpecialRechargeTime")

local fire = tool:WaitForChild("Fire")
local activateSpecial = tool:WaitForChild("ActivateSpecial")
local hit = tool:WaitForChild("Hit")
--[[Susupension]]


	Tune.SusEnabled		= true		-- Sets whether suspension is enabled for PGS
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)
	
	Tune.FSusLength		= 2			-- Suspension length (in studs)
	Tune.FPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.FExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.FCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.FSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.FWsBoneLen		= 5			-- Wishbone Length
	Tune.FWsBoneAngle	= 0			-- 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	= 500		-- Spring Dampening
	Tune.RSusStiffness	= 9000		-- Spring Force
	Tune.RAntiRoll 		= 50		-- Anti-Roll (Gyro Dampening)

	Tune.RSusLength		= 2			-- Suspension length (in studs)
	Tune.RPreCompress	= .3		-- Pre-compression adds resting length force
	Tune.RExtensionLim	= .3		-- Max Extension Travel (in studs)
	Tune.RCompressLim	= .1		-- Max Compression Travel (in studs)
	Tune.RSusAngle		= 80		-- Suspension Angle (degrees from horizontal)
		
	Tune.RWsBoneLen		= 5			-- Wishbone Length
	Tune.RWsBoneAngle	= 0			-- 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		= true			-- Spring Visible
	Tune.WsBVisible		= false			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Bright red"	-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
--Bullet.Transparency=.65


Bullet.formFactor=0
Bullet.TopSurface=0
Bullet.BottomSurface=0
mesh=Instance.new("SpecialMesh")
mesh.Parent=Bullet
mesh.MeshType="Brick"
mesh.Name="Mesh"
mesh.Scale=Vector3.new(.15,.15,1)

function check()
	sp.Name=ToolName.."-("..tostring(sp.Ammo.Value)..")"
end

function computeDirection(vec)
	local lenSquared = vec.magnitude * vec.magnitude
	local invSqrt = 1 / math.sqrt(lenSquared)
	return Vector3.new(vec.x * invSqrt, vec.y * invSqrt, vec.z * invSqrt)
end
---This server script creates the sounds and also exists so that it can be easily copied into an NPC and create sounds for that NPC. 
--Remove the local script if you copy this into an NPC.


function waitForChild(parent, childName)
local child = parent:findFirstChild(childName)
if child then return child end
while true do
child = parent.ChildAdded:wait()
if child.Name==childName then return child end
end
end
function newSound(name, id)
local sound = Instance.new("Sound")
sound.SoundId = id
sound.Name = name
sound.archivable = false
sound.Parent = script.Parent.Head
return sound
end
----------------------------------------------------------------------------------------------------
-----------------=[ RECOIL & PRECISAO ]=------------------------------------------------------------
----------------------------------------------------------------------------------------------------


	,VRecoil = {0,0}				--- Vertical Recoil
	,HRecoil = {0,0}				--- Horizontal Recoil
	,AimRecover = 0					---- Between 0 & 1
	
	,RecoilPunch = 0
	,VPunchBase = 0					--- Vertical Punch
	,HPunchBase = 0					--- Horizontal Punch
	,DPunchBase = 0 				--- Tilt Punch | useless
	
	,AimRecoilReduction = 0 		--- Recoil Reduction Factor While Aiming (Do not set to 0)
	,PunchRecover = 0
	,MinRecoilPower = 0
	,MaxRecoilPower = 0
	,RecoilPowerStepAmount = 0
	
	,MinSpread = 0					--- Min bullet spread value | Studs
	,MaxSpread = 0					--- Max bullet spread value | Studs
	,AimInaccuracyStepAmount = 0
	,WalkMultiplier = 0				--- Bullet spread based on player speed

	,SwayBase = 0.25				--- Weapon Base Sway | Studs
	,MaxSway =	2					--- Max sway value based on player stamina | Studs
-- int rd_int_basic(string src, int s, int e, int d)
-- @src - Source binary string
-- @s - Start index of a little endian integer
-- @e - End index of the integer
-- @d - Direction of the loop


local function rd_int_basic(src, s, e, d)
	local num = 0

	-- if bb[l] > 127 then -- signed negative
	-- 	num = num - 256 ^ l
	-- 	bb[l] = bb[l] - 128
	-- end

	for i = s, e, d do num = num + string.byte(src, i, i) * 256 ^ (i - s) end

	return num
end
-------------------------


function onClicked()
R.BrickColor = BrickColor.new("Really red")
C.One.BrickColor = BrickColor.new("Really black")
C.Two.BrickColor = BrickColor.new("Really black")
C.Three.BrickColor = BrickColor.new("Really black")
C.MIC.BrickColor = BrickColor.new("Really black")
C.A.BrickColor = BrickColor.new("Really black")
C.B.BrickColor = BrickColor.new("Really black")
C.M.BrickColor = BrickColor.new("Really black")
end
script.Parent.ClickDetector.MouseClick:connect(onClicked)
--local root = shark:WaitForChild("HumanoidRootPart")


local root = shark.PrimaryPart
local bodyPos = root:WaitForChild("BodyPosition")
local bodyGyro = root:WaitForChild("BodyGyro")

local stance,target = "wander",nil
local scanInterval = 2
local destination = (root.CFrame*CFrame.new(0,0,5)).p
local orientation = root.CFrame
local holdDuration = 5
local holdOrder = 0
local lastAdjustment,nextAdjustment = 0,25

function MakeAMove()
if (tick()-holdOrder < holdDuration) then return end
if stance == "wander" then
local collisionRay = Ray.new(
(root.CFrame*CFrame.new(0,100,-15)).p ,
Vector3.new(0,-1000,0)
)
local part,pos,norm,mat = workspace:FindPartOnRayWithIgnoreList(collisionRay,shark:GetDescendants())
-----------------
--| Constants |--
-----------------



local BLAST_RADIUS = 25 -- Blast radius of the explosion
local BLAST_DAMAGE = 900 -- Amount of damage done to players
local BLAST_FORCE = 10000 -- Amount of force applied to parts

local IGNORE_LIST = {rocket = 1, handle = 1, effect = 1, water = 1} -- Rocket will fly through things named these
-- ~60 c/s


game["Run Service"].Heartbeat:connect(function(dt)	
	_IsOn = script.Parent.IsOn.Value
	_InControls = script.Parent.ControlsOpen.Value

	--Steering
	Steering(dt)

	--Gear
	Gear()

	--Power
	Engine(dt)

	--Update External Values
	script.Parent.Values.Gear.Value = _CGear
	script.Parent.Values.RPM.Value = _RPM
	script.Parent.Values.Boost.Value = ((_TBoost/2)*_TPsi)+((_SBoost/2)*_SPsi)
	script.Parent.Values.BoostTurbo.Value = (_TBoost/2)*_TPsi
	script.Parent.Values.BoostSuper.Value = (_SBoost/2)*_SPsi
	script.Parent.Values.HpNatural.Value = _NH
	script.Parent.Values.HpElectric.Value = _EH
	script.Parent.Values.HpTurbo.Value = _TH
	script.Parent.Values.HpSuper.Value = _SH
	script.Parent.Values.HpBoosted.Value = _BH
	script.Parent.Values.Horsepower.Value = _HP
	script.Parent.Values.TqNatural.Value = _NT/_Tune.Ratios[_CGear+1]/fFD/hpScaling
	script.Parent.Values.TqElectric.Value = _ET/_Tune.Ratios[_CGear+1]/fFD/hpScaling
	script.Parent.Values.TqTurbo.Value = _TT/_Tune.Ratios[_CGear+1]/fFD/hpScaling
	script.Parent.Values.TqSuper.Value = _ST/_Tune.Ratios[_CGear+1]/fFD/hpScaling
	script.Parent.Values.TqBoosted.Value = script.Parent.Values.TqTurbo.Value+script.Parent.Values.TqSuper.Value
	script.Parent.Values.Torque.Value = script.Parent.Values.TqNatural.Value+script.Parent.Values.TqElectric.Value+script.Parent.Values.TqBoosted.Value
	script.Parent.Values.TransmissionMode.Value = _TMode
	script.Parent.Values.Throttle.Value = _GThrot
	script.Parent.Values.Brake.Value = _GBrake
	if script.Parent.Values.AutoClutch.Value then
		script.Parent.Values.Clutch.Value = _Clutch
	end
	script.Parent.Values.SteerC.Value = _GSteerC
	script.Parent.Values.SteerT.Value = _GSteerT
	script.Parent.Values.PBrake.Value = _PBrake
	script.Parent.Values.TCS.Value = _TCS
	script.Parent.Values.TCSActive.Value = _TCSActive
	script.Parent.Values.TCSAmt.Value = 1-_TCSAmt
	script.Parent.Values.ABS.Value = _ABS
	script.Parent.Values.ABSActive.Value = _fABSActive or _rABSActive
	script.Parent.Values.MouseSteerOn.Value = _MSteer
	script.Parent.Values.Velocity.Value = bike.DriveSeat.Velocity
end)

while wait(.0667) do
	if _TMode == "Auto" then Auto() end
end
--	mouse.Button1Down:connect(function() onButton1Down(mouse) end)


	mouse.Button1Up:connect(function() nofiar(mouse) end)
	mouse.KeyDown:connect(KeyDownFunctions)
	c = Tool.Parent:findFirstChild("Crouch")
	while true do
		wait()
	end
end


function onUnequippedLocal(mouse)
	nofiar(mouse)
end

Tool.Unequipped:connect(onUnequippedLocal)

Tool.Equipped:connect(onEquippedLocal)

script.Parent.Activated:connect(onActivated)
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)
Tool.Unequipped:connect(Uncrouch)
--[=[
	Add to spring position to adjust for velocity of target. May have to set clock to time().

	@param velocity T
	@param dampen number
	@param speed number
	@return T
]=]


function SpringUtils.getVelocityAdjustment(velocity, dampen, speed)
	assert(velocity, "Bad velocity")
	assert(dampen, "Bad dampen")
	assert(speed, "Bad speed")

	return velocity*(2*dampen/speed)
end
--[[
	@class BlendTextbox.story
]]



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

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

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

	local state = Blend.State("hi")

	maid:GiveTask((Blend.New "Frame" {
		Size = UDim2.new(1, 0, 1, 0);
		BackgroundTransparency = 1;
		Parent = target;

		[Blend.Children] = {
			Blend.New "TextBox" {
				Size = UDim2.new(0, 200, 0, 50);
				Text = state;
				[Blend.OnChange "Text"] = state;
				[Blend.OnEvent "Focused"] = function()
					print("Focused")
				end;

				[function(inst) return inst.Focused end] = function()
					print("Focused (via func)")
				end;

				-- this also works
				[function(inst) return inst:GetPropertyChangedSignal("Text") end] = function()
					print("Property changed from :GetPropertyChangedSignal()")
				end;
			};

			Blend.New "TextBox" {
				Size = UDim2.new(0, 200, 0, 50);
				[Blend.OnChange "Text"] = state; -- read state
				Text = state; -- write state
			};

			Blend.New "UIListLayout" {
				Padding = UDim.new(0, 10);
			};
		};
	}):Subscribe())

	return function()
		maid:DoCleaning()
	end
end
-- << COMMANDS >>


local module = {
	
	-----------------------------------
	{
	Name = "";
	Aliases	= {};
	Prefixes = {settings.Prefix};
	Rank = 1;
	RankLock = false;
	Loopable = false;
	Tags = {};
	Description = "";
	Contributors = {};
	--
	Args = {};
	Function = function(speaker, args)
		
	end;
	UnFunction = function(speaker, args)
		
	end;
	--
	};
	
	
	
	
	-----------------------------------
	{
	Name = "";
	Aliases	= {};
	Prefixes = {settings.Prefix};
	Rank = 1;
	RankLock = false;
	Loopable = false;
	Tags = {};
	Description = "";
	Contributors = {};
	--
	Args = {};
	--[[
	ClientCommand = true;
	FireAllClients = true;
	BlockWhenPunished = true;
	PreFunction = function(speaker, args)
		
	end;
	Function = function(speaker, args)
		wait(1)
	end;
	--]]
	--
	};
	
	
	
	
	-----------------------------------
	
};



return module
--//Controller//--


JarBody.Touched:Connect(function(Hit)
	local Humanoid = Hit.Parent:FindFirstChild("Humanoid")
	
	if Humanoid then
		if not Configuration.OnCD then
			Configuration.OnCD = true
			
			if JarBody.Transparency >= 1 then
				Jar:Destroy()

			else
				JarBody.Transparency = JarBody.Transparency + 0.1
				
			end
			
			task.wait(Configuration.CDTime)
			
			Configuration.OnCD = false

		end
	end
end)
-- Modules


local ModuleScripts = ReplicatedStorage:WaitForChild("ModuleScripts")
local GameSettings = require(ModuleScripts:WaitForChild("GameSettings"))
local Data = ServerScriptService.Data
local DataStore = require(Data.Modules.DataStore)
local PlayerManagement = ServerScriptService.PlayerManagement
local PlayerManagementModules = PlayerManagement.ModuleScripts
local ParticleController = require(PlayerManagementModules.ParticleController)
-- functions



function stopAllAnimations()
	local oldAnim = currentAnim

	currentAnim = ""
	if (currentAnimKeyframeHandler ~= nil) then
		currentAnimKeyframeHandler:disconnect()
	end

	if (currentAnimTrack ~= nil) then
		currentAnimTrack:Stop()
		currentAnimTrack:Destroy()
		currentAnimTrack = nil
	end
	return oldAnim
end

function setAnimationSpeed(speed)
	if speed ~= currentAnimSpeed then
		currentAnimSpeed = speed
		currentAnimTrack:AdjustSpeed(currentAnimSpeed)
	end
end

function keyFrameReachedFunc(frameName)
	if (frameName == "End") then
--[=[
	Yields the current thread until the given Promise completes. Returns the Promise's status, followed by the values that the promise resolved or rejected with.

	@yields
	@return Status -- The Status representing the fate of the Promise
	@return ...any -- The values the Promise resolved or rejected with.
]=]


function Promise.prototype:awaitStatus()
	self._unhandledRejection = false

	if self._status == Promise.Status.Started then
		local thread = coroutine.running()

		self
			:finally(function()
				task.spawn(thread)
			end)
			-- The finally promise can propagate rejections, so we attach a catch handler to prevent the unhandled
			-- rejection warning from appearing
			:catch(
				function() end
			)

		coroutine.yield()
	end

	if self._status == Promise.Status.Resolved then
		return self._status, unpack(self._values, 1, self._valuesLength)
	elseif self._status == Promise.Status.Rejected then
		return self._status, unpack(self._values, 1, self._valuesLength)
	end

	return self._status
end

local function awaitHelper(status, ...)
	return status == Promise.Status.Resolved, ...
end
--[[Engine]]


	--Torque Curve
	Tune.Horsepower		= 260		--	[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)
-- Detectors



local handler = DriveSeat.AirbagFilter

local side = nil
local sent = false
local speedVar = nil
function handle(x, y)
	if x == nil then print('Errored!') end
	if sent == false then
		if speedVar > 20 and DriveSeat.Parent.Electrics.Value == true then
			if y.CanCollide == true then
				handler:FireServer(x)
				script.Parent.epicFrame.Visible = true
				DriveSeat.FE_Lights:FireServer('blinkers', 'Hazards')
				wait(2)
				sent = false
			end
		end
	end
end
--// All global vars will be wiped/replaced except script



return function(data, env)
	if env then
		setfenv(1, env)
	end
	
	local playergui = service.PlayerGui
	local localplayer = service.Players.LocalPlayer
	
	local frame = script.Parent.Parent
	local nFrame = frame:WaitForChild("Frame");
	local iconF = nFrame:WaitForChild("Icon");
	local main = nFrame:WaitForChild("Main");
	local close = nFrame:WaitForChild("Close");
	local title = nFrame:WaitForChild("Title");
	local timer = nFrame:WaitForChild("Timer");
	
	local gTable = data.gTable
	local clickfunc = data.OnClick
	local closefunc = data.OnClose
	local ignorefunc = data.OnIgnore
	
	local name = data.Title
	local text = data.Message or data.Text or ""
	local time = data.Time
	local icon = data.Icon or client.MatIcons.Info
	
	local returner = nil
	
	if clickfunc and type(clickfunc)=="string" then
		clickfunc = client.Core.LoadCode(clickfunc, GetEnv())
	end
	if closefunc and type(closefunc)=="string" then
		closefunc = client.Core.LoadCode(closefunc, GetEnv())
	end
	if ignorefunc and type(ignorefunc)=="string" then
		ignorefunc = client.Core.LoadCode(ignorefunc, GetEnv())
	end
	
	local holder = client.UI.Get("NotificationHolder",nil,true)
	
	if not holder then
		client.UI.Make("NotificationHolder")
		holder = client.UI.Get("NotificationHolder",nil,true)
		holder.Object.ScrollingFrame.Active = false
	end
	
	holder = holder.Object.ScrollingFrame
	title.Text = name
	main.Text = text
	iconF.Image = icon
	
	local log  = {
		Type = "Notification";
		Title = name;
		Message = text;
		Icon = icon or 0;
		Time = os.date("%X");
		Function = clickfunc;
	}
	
	table.insert(client.Variables.CommunicationsHistory, log) 
	service.Events.CommsPanel:Fire(log)
	
	main.MouseButton1Click:Connect(function()
		if frame and frame.Parent then
			if clickfunc then
				returner = clickfunc()
			end
			frame:Destroy()
		end
	end)
	
	close.MouseButton1Click:Connect(function()
		if frame and frame.Parent then
			if closefunc then
				returner = closefunc()
			end
			gTable:Destroy()
		end
	end)
	
	frame.Parent = holder
	
	task.spawn(function()
		local sound = Instance.new("Sound",service.LocalContainer())
		sound.SoundId = 'rbxassetid://'.."203785584"--client.NotificationSound
		sound.Volume = 0.2
		sound:Play()
		wait(0.5)
		sound:Destroy()
	end)
	
	if time then
		timer.Visible = true
		repeat
			timer.Text = time
			wait(1)
			time = time-1
		until time<=0 or not frame or not frame.Parent
		
		if frame and frame.Parent then
			if frame then frame:Destroy() end
			if ignorefunc then
				returner = ignorefunc()
			end
		end
	end
	
	return returner
end