Pinkstack/roblox-luau-corpus-text huggingface dataset:
--Main function


local function AttachAuraControl(source_part, eff_cont) --(source_part, effect_container)
	
	local AnimObj
	
	local function Start()
		AnimObj = {}
		AnimObj["LastUpdate"] = tick()
		
		AnimObj["Parts"] = {}
		
		for i = 1, 6 do
			local np = EFFECT_LIB.NewInvisiblePart()
			np.Transparency = 1
			
			local fire = Instance.new("Fire")
            fire.Color = Color3.new(255, 0, 127)
            fire.SecondaryColor = Color3.new(255, 85, 127)
            fire.Heat = 5
            fire.Size = 4
            fire.Parent = np
			
			AnimObj["Parts"][i] = np
	
			np.Parent = eff_cont
		end
	end
	
	local function Update()
		local loop = EFFECT_LIB.Loop(4)
		local loop2 = EFFECT_LIB.Loop(0.8)
		
		for i = 1, #AnimObj["Parts"] do
			AnimObj["Parts"][i].CFrame = source_part.CFrame * CFrame.Angles(1, math.rad(loop * 360 + (360 / #AnimObj["Parts"] * (i - 1))), 0) * CFrame.new(0, 0, -3) * CFrame.Angles(0, math.rad(90), 0) * CFrame.Angles(math.rad(loop2 * -360 + (i * 180)), 0, 0)
		end
	end
	
	local function Stop()
		eff_cont:ClearAllChildren()
		AnimObj = nil
	end
	
	return {Start = Start, Update = Update, Stop = Stop}
end

return AttachAuraControl
-- Remeber to select the animtion object and set the id to your own!


local walkAnim = script:WaitForChild("Walk")
local walkAnimTrack = humanoid.Animator:LoadAnimation(walkAnim)

local idleAnim = script:WaitForChild("Idle")
local idleAnimTrack = humanoid.Animator:LoadAnimation(idleAnim)

humanoid.Running:Connect(function(speed)
	if speed > 0 then
		if not walkAnimTrack.IsPlaying and idleAnimTrack.IsPlaying then
			idleAnimTrack:Stop()
			walkAnimTrack:Play()
		end
	else
		if walkAnimTrack.IsPlaying and not idleAnimTrack.IsPlaying then
			idleAnimTrack:Play()
			walkAnimTrack:Stop()
		end
	end
end)

idleAnimTrack:Play()
--[[
	Used to set a handler for when the promise resolves, rejects, or is
	cancelled.
]]


function Promise.prototype:_finally(traceback, finallyHandler)
	self._unhandledRejection = false

	local promise = Promise._new(traceback, function(resolve, reject, onCancel)
		local handlerPromise

		onCancel(function()
			-- The finally Promise is not a proper consumer of self. We don't care about the resolved value.
			-- All we care about is running at the end. Therefore, if self has no other consumers, it's safe to
			-- cancel. We don't need to hold out cancelling just because there's a finally handler.
			self:_consumerCancelled(self)

			if handlerPromise then
				handlerPromise:cancel()
			end
		end)

		local finallyCallback = resolve
		if finallyHandler then
			finallyCallback = function(...)
				local callbackReturn = finallyHandler(...)

				if Promise.is(callbackReturn) then
					handlerPromise = callbackReturn

					callbackReturn
						:finally(function(status)
							if status ~= Promise.Status.Rejected then
								resolve(self)
							end
						end)
						:catch(function(...)
							reject(...)
						end)
				else
					resolve(self)
				end
			end
		end

		if self._status == Promise.Status.Started then
			-- The promise is not settled, so queue this.
			table.insert(self._queuedFinally, finallyCallback)
		else
			-- The promise already settled or was cancelled, run the callback now.
			finallyCallback(self._status)
		end
	end)

	return promise
end
---SG Is  Here---
---Please Dont Change Anything Can Dont Work If You Change--



function onClick()
	script.Parent.Parent.Active = false
	script.Parent.Parent.Visible = false
	
	script.Parent.Parent.Parent.ReFrame.Active = true
	script.Parent.Parent.Parent.ReFrame.Visible = true
end

script.Parent.MouseButton1Click:connect(onClick)
--[=[
	@param ignorePlayer Player -- The client to ignore
	@param ... any -- Arguments passed to the other clients
	Fires the signal to all clients _except_ the specified
	client.

	:::note Outbound Middleware
	All arguments pass through any outbound middleware (if any)
	before being sent to the clients.
	:::
]=]


function RemoteSignal:FireExcept(ignorePlayer: Player, ...: any)
	self:FireFilter(function(plr)
		return plr ~= ignorePlayer
	end, ...)
end
--                    The maximum is 1. Volumes set above 1 will be unaffected. 
--                    For music heard across the game, if you have other sounds, put this to 0.9 or 1, otherwise you won't hear your music because of the other sounds
--


music.Looped = false -- This determines if the sound will repeat forever. If you have more than one sound, you MUST set this to false, otherwise you will be able to
-- ================================================================================
-- LOCAL FUNCTIONS
-- ================================================================================


local function GetMass(parent)
	local mass = 0
	for _,v in pairs(parent:GetChildren()) do
		if (v:IsA("BasePart") or v:IsA("MeshPart")) then
			if not v.Massless then
				mass = (mass + v:GetMass())
			end
		end
		mass = mass + GetMass(v)
	end
	
	return mass
end -- GetMass()

local function SetMassless(parent, self)
	for _,part in pairs(parent:GetDescendants()) do
		if ((part:IsA("BasePart") or part:IsA("MeshPart")) and (part ~= self.main)) then
			part.Massless = true
		end
	end
end -- SetMassless
--[[
	Main RenderStep Update. The camera controller and occlusion module both have opportunities
	to set and modify (respectively) the CFrame and Focus before it is set once on CurrentCamera.
	The camera and occlusion modules should only return CFrames, not set the CFrame property of
	CurrentCamera directly.
--]]


function CameraModule:Update(dt)
	if self.activeCameraController then
		if FFlagUserCameraToggle then
			self.activeCameraController:UpdateMouseBehavior()
		end

		local newCameraCFrame, newCameraFocus = self.activeCameraController:Update(dt)
		self.activeCameraController:ApplyVRTransform()
		if self.activeOcclusionModule then
			newCameraCFrame, newCameraFocus = self.activeOcclusionModule:Update(dt, newCameraCFrame, newCameraFocus)
		end

		-- Here is where the new CFrame and Focus are set for this render frame
		game.Workspace.CurrentCamera.CFrame = newCameraCFrame
		game.Workspace.CurrentCamera.Focus = newCameraFocus

		-- Update to character local transparency as needed based on camera-to-subject distance
		if self.activeTransparencyController then
			self.activeTransparencyController:Update()
		end
	end
end
-- Signal:Fire(...) implemented by running the handler functions on the
-- coRunnerThread, and any time the resulting thread yielded without returning
-- to us, that means that it yielded to the Roblox scheduler and has been taken
-- over by Roblox scheduling, meaning we have to make a new coroutine runner.


function Signal:Fire(...)
	local item = self._handlerListHead
	while item do
		if item._connected then
			if not freeRunnerThread then
				freeRunnerThread = coroutine.create(runEventHandlerInFreeThread)
			end
			task.spawn(freeRunnerThread, item._fn, ...)
		end
		item = item._next
	end
end
--- Constants used to decide when to notify that the chat filter is having issues filtering messages.


local FILTER_NOTIFCATION_THRESHOLD = 3 --Number of notifcation failures before an error message is output.
local FILTER_NOTIFCATION_INTERVAL = 60 --Time between error messages.
local FILTER_THRESHOLD_TIME = 60 --If there has not been an issue in this many seconds, the count of issues resets.

local module = {}

local RunService = game:GetService("RunService")
local Chat = game:GetService("Chat")
local ReplicatedModules = Chat:WaitForChild("ClientChatModules")

local modulesFolder = script.Parent
local ReplicatedModules = Chat:WaitForChild("ClientChatModules")
local ChatSettings = require(ReplicatedModules:WaitForChild("ChatSettings"))

local errorTextColor = ChatSettings.ErrorMessageTextColor or Color3.fromRGB(245, 50, 50)
local errorExtraData = {ChatColor = errorTextColor}
--Checks for collisions----------


local function CheckHitbox(Character, Object, Plot)
	if not Object then return false end	
	local CollisionPoints = workspace:GetPartsInPart(Object.PrimaryPart)

	--Checks if there is collision on any object that is not a child and is not the player----------
	for i = 1, #CollisionPoints, 1 do
		if not CollisionPoints[i].CanTouch then continue end
		if not (not CollisionPoints[i]:IsDescendantOf(Object) and not CollisionPoints[i]:IsDescendantOf(Character)) and not (CollisionPoints[i] == Plot) then continue end

		return true
	end

	return false
end
------------------------------------------------------------------------
-- check whether list has any jump that do not produce a value
-- (or produce an inverted value)
-- * return value changed to boolean
-- * used only in luaK:exp2reg()
------------------------------------------------------------------------


function luaK:need_value(fs, list)
  while list ~= self.NO_JUMP do
    local i = self:getjumpcontrol(fs, list)
    if luaP:GET_OPCODE(i) ~= "OP_TESTSET" then return true end
    list = self:getjump(fs, list)
  end
  return false  -- not found
end
--[[
				hitsound.Volume=.5+(.5*math.random())
				hitsound.Pitch=.5+math.random()
				hitsound:Play()
--]]


				if RightShoulder and LeftShoulder then
					RightShoulder.CurrentAngle=0
					LeftShoulder.CurrentAngle=0
				end
			end
		end
		lastattack=time
	end
end


Humanoid.Died:connect(onDied)
Humanoid.Running:connect(onRunning)
Humanoid.Jumping:connect(onJumping)
Humanoid.Climbing:connect(onClimbing)
Humanoid.GettingUp:connect(onGettingUp)
Humanoid.FreeFalling:connect(onFreeFall)
Humanoid.FallingDown:connect(onFallingDown)
Humanoid.Seated:connect(onSeated)
Humanoid.PlatformStanding:connect(onPlatformStanding)


function populatehumanoids(mdl)
	if mdl.ClassName=="Humanoid" then
		table.insert(humanoids,mdl)
	end
	for i2,mdl2 in ipairs(mdl:GetChildren()) do
		populatehumanoids(mdl2)
	end
end
--[[
	    ___      _______                _       _______
	   / _ |____/ ___/ /  ___ ____ ___ (_)__   /__  __/
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<     / /
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/	/_/   
						SecondLogic @ Inspare
						Avxnturador @ Novena
]]




local autoscaling	= true					--Estimates top speed

local UNITS	= {								--Click on speed to change units
											--First unit is default	
	
	
	{
		units			= "KM/H"			,
		scaling			= (10/12) * 1.09728	, -- 1 stud : 10 inches | ft/s to KP/H
		maxSpeed		= 370				,
		spInc			= 40				, -- Increment between labelled notches
	},
	
	
}
-- DO NOT EDIT THE BELOW UNLESS YOU'RE A SCRIPTER AND KNOW WHAT YOU'RE DOING! --



local songValues = {}
local songs = script.Parent:GetChildren()

for i,v in pairs(songs) do
	if v:IsA("IntValue") and v.Name == "MusicId" then
		table.insert(songValues, v.Value)
	end
end

local sound = Instance.new("Sound",script.Parent)
sound.Name = "MusicPlayer"

if looped == true then
	sound.Looped = true
else
	sound.Looped = false
end

sound.Pitch = pitch
sound.Volume = volume

while true do
	sound.SoundId = "rbxassetid://"..songValues[math.random(1,#songValues)]
	sound:Play()
	wait(songPlayTime)
	sound:Stop()
	wait(nextSongPlayTime)
end
--[[Weld functions]]



	local JS = game:GetService("JointsService")
	local PGS_ON = workspace:PGSIsEnabled()
	
	function MakeWeld(x,y,type,s) 
		if type==nil then type="Weld" end
		local W=Instance.new(type,JS) 
		W.Part0=x W.Part1=y 
		W.C0=x.CFrame:inverse()*x.CFrame 
		W.C1=y.CFrame:inverse()*x.CFrame 
		if type=="Motor" and s~=nil then 
			W.MaxVelocity=s 
		end 
		return W	
	end
	
	function ModelWeld(a,b) 
		if a:IsA("BasePart") and 
			a.Parent.Name ~= ("RotLight") then 
			MakeWeld(b,a,"Weld")
			for i,v in pairs(a:GetChildren()) do 
				if v ~= nil and v:IsA("BasePart") then
					ModelWeld(v,b) 
				end
			end
		elseif a:IsA("Model") then 
			for i,v in pairs(a:GetChildren()) do 
				ModelWeld(v,b) 
			end 
		end 
	end
	
	function UnAnchor(a) 
		if a:IsA("BasePart") then a.Anchored=false  end for i,v in pairs(a:GetChildren()) do UnAnchor(v) end 
	end
--[[Engine]]



	--		[TORQUE CURVE VISUAL]
	--		https://www.desmos.com/calculator/nap6stpjqf
	--		Use sliders to manipulate values
	--		Edit everything as if your car is NATURALLY aspirated, or as if it lacks a turbo.
	
	Tune.Horsepower		= 950
	Tune.IdleRPM		= 700
	Tune.PeakRPM		= 7000
	Tune.Redline		= 8500
	Tune.EqPoint		= 5252
	Tune.PeakSharpness	= 20
	Tune.CurveMult		= 0.2
	
	Tune.InclineComp	= 1.7		-- Torque compensation multiplier for inclines (applies gradient from 0-90 degrees)
	
	--Turbo Settings
	Tune.Aspiration		= "Single"												--[[
	[Aspiration]
		"Natural"		: N/A, Naturally aspirated engine
		"Single"		: Single turbocharger
		"Double"		: Twin turbocharger											]]
	
	Tune.Boost			= 30		--Max PSI per turbo (If you have two turbos and this is 15, the PSI will be 30)
	Tune.TurboSize		= 54		--Turbo size; the bigger it is, the more lag it has.
	Tune.CompressRatio	= 9			--The compression ratio (look it up)
	
	--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, lower = more stable RPM)
--!strict


return {
	concat = require(script.concat),
	every = require(script.every),
	filter = require(script.filter),
	find = require(script.find),
	findIndex = require(script.findIndex),
	forEach = require(script.forEach),
	from = require(script.from),
	includes = require(script.includes),
	indexOf = require(script.indexOf),
	isArray = require(script.isArray),
	join = require(script.join),
	map = require(script.map),
	reduce = require(script.reduce),
	reverse = require(script.reverse),
	shift = require(script.shift),
	slice = require(script.slice),
	some = require(script.some),
	sort = require(script.sort),
	splice = require(script.splice),
	unshift = require(script.unshift),
}
--[[Transmission]]


	Tune.TransModes		= {"Auto", "Semi"}								--[[
	[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	= "RPM"												--[[
	[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		= 6.20		-- 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 ]]		5		,	-- Reverse, Neutral, and 1st gear are required
		--[[ 2 ]]		1.99		,
		--[[ 3 ]]		1.25		,
		--[[ 4 ]]		0.98		,
		--[[ 5 ]]		0.71		,
		--[[ 6 ]]		0.54		,
		--[[ 7 ]]		0.45		,
	}
	Tune.FDMult			= 1.5			-- Ratio multiplier (Change this value instead of FinalDrive if car is struggling with torque ; Default = 1)
-- Channel Functions --



function ChannelDown()
	channel.Value = channel.Value - 1
end

TV.CButtonDown.ClickDetector.MouseClick:Connect(ChannelDown)

function ChannelUp()
	channel.Value = channel.Value + 1
end

TV.CButtonUp.ClickDetector.MouseClick:Connect(ChannelUp)


local function ChangeChannel()
	if channel.Value < 1 then -- If the VALUE is 0, the script won't work bc the value is nil on the tables.
		channel.Value = MaxChannel -- You can change the MaxChannel value if you like.
	elseif channel.Value > MaxChannel then
		channel.Value = 1
	else
		music.SoundId = songs[channel.Value]
		music:Play()
		img.Texture = images[channel.Value]
		
	end
end


channel.Changed:Connect(ChangeChannel)
--[=[
	Use to test that the given GuiObject or Rect is above the other GuiObject or
	Rect.

	The last argument is optional. If nil, the matcher will pass only if the
	difference **bottom** edge of the given GuiObject or Rect and the **top**
	edge of the other GuiObject or Rect is zero or positive.

	Usage:

	```lua
	expect(a).toBeAbove(b) -- Jest
	expect(a).to.be.above(b) -- TestEZ
	```

	![Example of above(a, b)](/above(a,%20b).png)

	```lua
	expect(a).toBeAbove(b, 5) -- Jest
	expect(a).to.be.above(b, 5) -- TestEZ
	```

	![Example of above(a, b, 5)](/above(a,%20b,%205).png)

	```lua
	expect(a).toBeAbove(b, NumberRange.new(0, 5)) -- Jest
	expect(a).to.be.above(b, NumberRange.new(0, 5)) -- TestEZ
	```

	![Example of above(a, b, NumberRange.new(0, 5))](/above(a,%20b,%20NumberRange.new(0,%205)).png)

	@tag outside
	@within CollisionMatchers2D
]=]


local function above(a: GuiObject | Rect, b: GuiObject | Rect, distance: number)
	local aRect = toRect(a)
	local bRect = toRect(b)

	local distanceFromSide = -(aRect.Max - bRect.Min)
	if distance then
		if typeof(distance) == "number" then
			distance = NumberRange.new(distance)
		end

		return returnValue(
			distance.Min <= distanceFromSide.Y and distance.Max >= distanceFromSide.Y,
			"Was within range",
			"Was not within range ( " .. tostring(distance) .. ")"
		)
	else
		return returnValue(distanceFromSide.Y >= 0, "Was above the element", "Was below the element")
	end
end

return above
--[[ Initialization/Setup ]]

--
local function createTouchGuiContainer()
	if TouchGui then TouchGui:Destroy() end
	
	-- Container for all touch device guis
	TouchGui = Instance.new('ScreenGui')
	TouchGui.Name = "TouchGui"
	TouchGui.Parent = PlayerGui
	
	TouchControlFrame = Instance.new('Frame')
	TouchControlFrame.Name = "TouchControlFrame"
	TouchControlFrame.Size = UDim2.new(1, 0, 1, 0)
	TouchControlFrame.BackgroundTransparency = 1
	TouchControlFrame.Parent = TouchGui
	
	ThumbstickModule:Create(TouchControlFrame)
	DPadModule:Create(TouchControlFrame)
	ThumbpadModule:Create(TouchControlFrame)
	TouchJumpModule:Create(TouchControlFrame)
end
--[[Susupension]]


	Tune.SusEnabled		= true		-- works only in with PGSPhysicsSolverEnabled, defaults to false when PGS is disabled
	
	--Front Suspension
	Tune.FSusDamping	= 500		-- Spring Dampening
	Tune.FSusStiffness	= 9000		-- Spring Force
	Tune.FAntiRoll 		= 1000		-- 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.FAntiRoll 		= 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		= false			-- Spring Visible
	Tune.WsBVisible		= true			-- Wishbone Visible
	Tune.SusRadius		= .2			-- Suspension Coil Radius
	Tune.SusThickness	= .1			-- Suspension Coil Thickness
	Tune.SusColor		= "Black"		-- Suspension Color [BrickColor]
	Tune.SusCoilCount	= 6				-- Suspension Coil Count
	Tune.WsColor		= "Black"		-- Wishbone Color [BrickColor]
	Tune.WsThickness	= .1			-- Wishbone Rod Thickness
-- // Copyright 2023, vracto, All rights reserved.



local hum = script.Parent:WaitForChild("Humanoid")
local seat = nil

hum.Seated:Connect(function(active, seatPart)
	seat = seatPart
end)

local w = false
local s = false
local a = false
local d = false

game:GetService("UserInputService").InputBegan:Connect(function(inp, processed)
	if processed then return end
	if inp.KeyCode == Enum.KeyCode.W then w = true end
	if inp.KeyCode == Enum.KeyCode.S then s = true end
	if inp.KeyCode == Enum.KeyCode.A then a = true end
	if inp.KeyCode == Enum.KeyCode.D then d = true end
end)

game:GetService("UserInputService").InputEnded:Connect(function(inp)
	if inp.KeyCode == Enum.KeyCode.W then w = false end
	if inp.KeyCode == Enum.KeyCode.S then s = false end
	if inp.KeyCode == Enum.KeyCode.A then a = false end
	if inp.KeyCode == Enum.KeyCode.D then d = false end
end)

local camera = workspace.CurrentCamera
local mouse = game.Players.LocalPlayer:GetMouse()
local aa = 0

game:GetService("RunService").RenderStepped:Connect(function()
	if seat then
		print(a)
		print(d)
		camera.CameraType = Enum.CameraType.Scriptable
		camera.CFrame = seat.Parent.Camera.CFrame * CFrame.Angles(math.rad((((mouse.Y - mouse.ViewSizeY / 2) / mouse.ViewSizeY)) * -20),math.rad((((mouse.X - mouse.ViewSizeX / 2) / mouse.ViewSizeX)) * -20),0)
		--seat.BodyGyro.CFrame = CFrame.new(seat.Parent.Body.Position, mouse.Hit.LookVector * 666)
		seat.BodyGyro.CFrame = CFrame.new(seat.Position, Vector3.new(mouse.Hit.X,mouse.Hit.Y,mouse.Hit.Z)) * CFrame.Angles(0, 0, math.rad(aa))
		if w then
			seat.BodyVelocity.Velocity = seat.CFrame.LookVector * 100
		elseif s then
			seat.BodyVelocity.Velocity = seat.CFrame.LookVector * -100
		else
			seat.BodyVelocity.Velocity = Vector3.new(0, 0, 0)
		end
		if a then
			aa+=3
		elseif d then
			aa+=-3
		else
			seat.BodyAngularVelocity.AngularVelocity = Vector3.new(0,0,0)
		end
	else 
		camera.CameraType = Enum.CameraType.Custom
	end
end)
--Automatic Transmission


function Auto()
	local maxSpin=0
	for i,v in pairs(Drive) do if v.RotVelocity.Magnitude>maxSpin then maxSpin = v.RotVelocity.Magnitude end end
	if _IsOn then
		_ClutchOn = true
		if _CGear >= 1 then
			if _GBrake > 0  and car.DriveSeat.Velocity.Magnitude < 5 then
				_CGear = 1
			else
				if _Tune.AutoShiftMode == "RPM" then
					if _RPM>(_Tune.PeakRPM+_Tune.AutoUpThresh) then
						if (_CGear ~= 0) and (_CGear ~= #_Tune.Ratios-2) then
							_GThrotShift = 0
							wait(_Tune.ShiftTime)
							_GThrotShift = 1
						end
						_CGear=math.min(_CGear+1,#_Tune.Ratios-2) 
					elseif math.max(math.min(maxSpin*_Tune.Ratios[_CGear+1]*fFDr,_Tune.Redline+100),_Tune.IdleRPM)<(_Tune.PeakRPM-_Tune.AutoDownThresh) then
						if _CGear ~= 1 then
							_GThrotShift = 0
							wait(_Tune.ShiftTime/2)
							_GThrotShift = 1
						end
						_CGear=math.max(_CGear-1,1)
					end
				else
					if car.DriveSeat.Velocity.Magnitude > math.ceil(wDRatio*(_Tune.PeakRPM+_Tune.AutoUpThresh)/_Tune.Ratios[_CGear+2]/fFD) then
						if (_CGear ~= 0) and (_CGear ~= #_Tune.Ratios-2) then
							_GThrotShift = 0
							wait(_Tune.ShiftTime)
							_GThrotShift = 1
						end
						_CGear=math.min(_CGear+1,#_Tune.Ratios-2)
					elseif car.DriveSeat.Velocity.Magnitude < math.ceil(wDRatio*(_Tune.PeakRPM-_Tune.AutoDownThresh)/_Tune.Ratios[_CGear+1]/fFD) then
						if _CGear ~= 1 then
							_GThrotShift = 0
							wait(_Tune.ShiftTime/2)
							_GThrotShift = 1
						end
						_CGear=math.max(_CGear-1,1)
					end
				end
			end
		end
	end 
end

local tqTCS = 1
local sthrot = 0
--// F key, Horn


mouse.KeyDown:connect(function(key)
	if key=="f" then 
		veh.Lightbar.middle.Airhorn:Play()
		veh.Lightbar.middle.Wail.Volume = 0
		veh.Lightbar.middle.Yelp.Volume = 0
		veh.Lightbar.middle.Priority.Volume = 0
		veh.Lightbar.middle.Manual.Volume = 0
	end
end)