Pinkstack/roblox-luau-corpus-text huggingface dataset:
-- Activation]:


if TurnCharacterToMouse == true then
	MseGuide = true
	HeadHorFactor = 0
	BodyHorFactor = 0
end

game:GetService("RunService").RenderStepped:Connect(function()
	local CamCF = Cam.CoordinateFrame
	if ((IsR6 and Body["Torso"]) or Body["UpperTorso"])~=nil and Body["Head"]~=nil then	--[Check for the Torso and Head...]
		local TrsoLV = Trso.CFrame.lookVector
		local HdPos = Head.CFrame.p
		if IsR6 and Neck or Neck and Waist then	--[Make sure the Neck still exists.]
			if Cam.CameraSubject:IsDescendantOf(Body) or Cam.CameraSubject:IsDescendantOf(Plr) then
				local Dist = nil;
				local Diff = nil;
				if not MseGuide then	--[If not tracking the Mouse then get the Camera.]
					Dist = (Head.CFrame.p-CamCF.p).magnitude
					Diff = Head.CFrame.Y-CamCF.Y
					if not IsR6 then	--[R6 and R15 Neck rotation C0s are different; R15: X axis inverted and Z is now the Y.]
						Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aSin(Diff/Dist)*HeadVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
						Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang((aSin(Diff/Dist)*BodyVertFactor), -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
					else	--[R15s actually have the properly oriented Neck CFrame.]
						Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aSin(Diff/Dist)*HeadVertFactor), 0, -(((HdPos-CamCF.p).Unit):Cross(TrsoLV)).Y*HeadHorFactor),UpdateSpeed/2)
					end
				else
					local Point = Mouse.Hit.p
					Dist = (Head.CFrame.p-Point).magnitude
					Diff = Head.CFrame.Y-Point.Y
					if not IsR6 then
						Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang(-(aTan(Diff/Dist)*HeadVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor, 0), UpdateSpeed/2)
						Waist.C0 = Waist.C0:lerp(WaistOrgnC0*Ang(-(aTan(Diff/Dist)*BodyVertFactor), (((HdPos-Point).Unit):Cross(TrsoLV)).Y*BodyHorFactor, 0), UpdateSpeed/2)
					else
						Neck.C0 = Neck.C0:lerp(NeckOrgnC0*Ang((aTan(Diff/Dist)*HeadVertFactor), 0, (((HdPos-Point).Unit):Cross(TrsoLV)).Y*HeadHorFactor), UpdateSpeed/2)
					end
				end
			end
		end
	end
	if TurnCharacterToMouse == true then
		Hum.AutoRotate = false
		Core.CFrame = Core.CFrame:lerp(CFrame.new(Core.Position, Vector3.new(Mouse.Hit.p.x, Core.Position.Y, Mouse.Hit.p.z)), UpdateSpeed / 2)
	else
		Hum.AutoRotate = true
	end
end)

game.ReplicatedStorage.Look.OnClientEvent:Connect(function(otherPlayer, neckCFrame, WaistCFrame)
	local Neck = otherPlayer.Character:FindFirstChild("Neck", true)
	local Waist = otherPlayer.Character:FindFirstChild("Waist", true)

	if Neck and Waist then
		game:GetService('TweenService'):Create(Neck, TweenInfo.new(.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0), {C0 = neckCFrame}):Play()
		game:GetService('TweenService'):Create(Waist, TweenInfo.new(.5, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false, 0), {C0 = WaistCFrame}):Play()
	end
end)

while wait(0.0001) do
	game.ReplicatedStorage.Look:FireServer(Neck.C0, Waist.C0)
end
-- SirNoobly



local hat = script.Parent
hat.PrimaryPart = hat:WaitForChild("Head") -- Make sure the Head is the same size as a normal Head.

function weldParts(part0, part1) -- welds the 2 parts based on their position
	local newWeld = Instance.new("Weld")
	newWeld.Part0  = part0
	newWeld.Part1  = part1
	newWeld.C0     = CFrame.new()
	newWeld.C1     = part1.CFrame:toObjectSpace(part0.CFrame)
	newWeld.Parent = part0
end

hat.Head.Touched:connect(function(hit)
	if hit.Parent:FindFirstChild("Humanoid")  and not hit.Parent:FindFirstChild("Earl's Coronet")then else return end

	local head = hit.Parent:FindFirstChild("Head")
	local newHat = hat:Clone()
	newHat:FindFirstChild("HatScript"):Destroy()
	newHat:SetPrimaryPartCFrame(head.CFrame) -- puts the head into the head
	newHat.PrimaryPart:Destroy()
	for _, part in pairs (newHat:GetChildren()) do
		if part:IsA("BasePart") then
			weldParts(head, part)
			part.CanCollide = false
			part.Anchored = false
		end
	end
	newHat.Parent = hit.Parent
end)
-- move front UI -- 


titleEnd = {}
titleEnd.Position = UDim2.new(0.04, 0, 0, 0)

soloEnd = {}
soloEnd.Position = UDim2.new(0.055, 0, 0.4, 0)

customizeEnd = {}
customizeEnd.Position = UDim2.new(0.055, 0 , 0.55, 0)

achievementsEnd = {}
achievementsEnd.Position = UDim2.new(0.055, 0 , 0.7, 0)

settingsEnd = {}
settingsEnd.Position = UDim2.new(0.055, 0 , 0.85, 0)

backEnd = {}
backEnd.Position = UDim2.new(0.5, 0, 1.5, 0)
--[=[
	@return Promise
	Returns a promise that is resolved once Knit has started. This is useful
	for any code that needs to tie into Knit controllers but is not the script
	that called `Start`.
	```lua
	Knit.OnStart():andThen(function()
		local MyController = Knit.GetController("MyController")
		MyController:DoSomething()
	end):catch(warn)
	```
]=]


function KnitClient.OnStart()
	if startedComplete then
		return Promise.resolve()
	else
		return Promise.fromEvent(onStartedComplete.Event)
	end
end


return KnitClient
--// Aim|Zoom|Sensitivity Customization


	ZoomSpeed = 0.23; -- The lower the number the slower and smoother the tween
	AimZoom = 70; -- Default zoom
	AimSpeed = 0.23;
	UnaimSpeed = 0.23;
	CycleAimZoom = 70; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy
--////////////////////////////// Include
--//////////////////////////////////////


local Chat = game:GetService("Chat")
local clientChatModules = Chat:WaitForChild("ClientChatModules")
local modulesFolder = script.Parent
local ChatSettings = require(clientChatModules:WaitForChild("ChatSettings"))
local CurveUtil = require(modulesFolder:WaitForChild("CurveUtil"))

local commandModules = clientChatModules:WaitForChild("CommandModules")
local WhisperModule = require(commandModules:WaitForChild("Whisper"))

local MessageSender = require(modulesFolder:WaitForChild("MessageSender"))

local ChatLocalization = nil
--// WebPanel module uploaded as a group model due to there being multiple maintainers
--// Module source available at https://www.roblox.com/library/6289861017/WebPanel-Module




return function(Vargs)
	local server = Vargs.Server;
	local service = Vargs.Service;

	local Settings = server.Settings
	local Functions, Commands, Admin, Anti, Core, HTTP, Logs, Remote, Process, Variables, Deps =
		server.Functions, server.Commands, server.Admin, server.Anti, server.Core, server.HTTP, server.Logs, server.Remote, server.Process, server.Variables, server.Deps

	--[[
		settings.WebPanel_Enabled = true;
		wait(1)
		settings.WebPanel_ApiKey = _G.ADONIS_WEBPANEL_TESTING_APIKEY;
	--]]

	--// Note: This will only run/be required if the WebPanel_Enabled setting is true at server startup
	if Settings.WebPanel_Enabled then
		local ran,WebModFunc = pcall(require, 6289861017)
		if ran and WebModFunc then
			coroutine.wrap(WebModFunc)(Vargs)
		elseif not ran then
			warn("WebPanel Loading Failed: ".. tostring(WebModFunc))
		end
	end

	Logs:AddLog("Script", "WebPanel Module Loaded");
end
-- Public Constructors



function SpringClass.new(stiffness, dampingCoeff, dampingRatio, initialPos)
	local self = setmetatable({}, SpringClass)
	
	self.instant = false
	self.marginOfError = 1E-6

	dampingRatio = dampingRatio or 1
	local m = dampingCoeff*dampingCoeff/(4*stiffness*dampingRatio*dampingRatio)
	self.k = stiffness/m
	self.d = -dampingCoeff/m
	self.x = initialPos
	self.t = initialPos
	self.v = initialPos*0

	return self
end
-- Constants


local FADE_IN_TWEEN = TweenInfo.new(1, Enum.EasingStyle.Linear)
local FADE_OUT_TWEEN = TweenInfo.new(1, Enum.EasingStyle.Linear)

local MusicPlayer = {}

function MusicPlayer:TransitionSoundVolumes(sounds: {Sound}, targetVolume: number, tweenInfo: TweenInfo)
	for _, sound in sounds do
		local tween = tweenService:Create(sound, tweenInfo, {Volume = targetVolume})
		tween:Play()
		
		if targetVolume > 0 and not sound.IsPlaying then
			sound:Play()
		elseif targetVolume == 0 and sound.IsPlaying then
			tween.Completed:Connect(function(playbackState)
				if playbackState == Enum.PlaybackState.Completed and targetVolume == 0 then
					sound:Stop()
				end
			end)
		end
	end
end

function MusicPlayer:FadeSoundsIn(sounds: {Sound})
	self:TransitionSoundVolumes(sounds, 0.5, FADE_IN_TWEEN)
end

function MusicPlayer:FadeSoundsOut(sounds: {Sound})
	self:TransitionSoundVolumes(sounds, 0, FADE_OUT_TWEEN)
end

return MusicPlayer
--["Walk"] = "rbxassetid://1136173829",


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

function Attack(thing,dmg)
if tick()-lastAttack > 2 then
hum:MoveTo(root.Position)
lastAttack = tick()
anims.Walk:Stop()
anims.SwingTool:Play()

if thing.ClassName == "Player" then
root.FleshHit:Play()
ant:SetPrimaryPartCFrame(CFrame.new(root.Position,Vector3.new(target.Character.PrimaryPart.Position.X,root.Position.Y,target.Character.PrimaryPart.Position.Z)))

elseif thing.ClassName == "Model" then
root.StructureHit:Play()
end

rep.Events.NPCAttack:Fire(thing,dmg) 
end
end


function Move(point)
hum:MoveTo(point)
if not anims.Walk.IsPlaying then
anims.Walk:Play()
end
end

function ScanForPoint()
local newPoint
local rayDir = Vector3.new(math.random(-100,100)/100,0,math.random(-100,100)/100)
local ray = Ray.new(root.Position,rayDir*math.random(10,50),ant)
local part,pos = workspace:FindPartOnRay(ray)
Move(pos)
enRoute = true
end
--[=[
	Tracks pending promises
	@class PendingPromiseTracker
]=]



local PendingPromiseTracker = {}
PendingPromiseTracker.ClassName = "PendingPromiseTracker"
PendingPromiseTracker.__index = PendingPromiseTracker

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

	self._pendingPromises = {}

	return self
end

function PendingPromiseTracker:Add(promise)
	if promise:IsPending() then
		self._pendingPromises[promise] = true
		promise:Finally(function()
			self._pendingPromises[promise] = nil
		end)
	end
end

function PendingPromiseTracker:GetAll()
	local promises = {}
	for promise, _ in pairs(self._pendingPromises) do
		table.insert(promises, promise)
	end
	return promises
end

return PendingPromiseTracker
--[=[
	An object to represent runtime errors that occur during execution.
	Promises that experience an error like this will be rejected with
	an instance of this object.

	@class Error
]=]


local Error do
	Error = {
		Kind = makeEnum("Promise.Error.Kind", {
			"ExecutionError",
			"AlreadyCancelled",
			"NotResolvedInTime",
			"TimedOut",
		}),
	}
	Error.__index = Error

	function Error.new(options, parent)
		options = options or {}
		return setmetatable({
			error = tostring(options.error) or "[This error has no error text.]",
			trace = options.trace,
			context = options.context,
			kind = options.kind,
			parent = parent,
			createdTick = os.clock(),
			createdTrace = debug.traceback(),
		}, Error)
	end

	function Error.is(anything)
		if type(anything) == "table" then
			local metatable = getmetatable(anything)

			if type(metatable) == "table" then
				return rawget(anything, "error") ~= nil and type(rawget(metatable, "extend")) == "function"
			end
		end

		return false
	end

	function Error.isKind(anything, kind)
		assert(kind ~= nil, "Argument #2 to Promise.Error.isKind must not be nil")

		return Error.is(anything) and anything.kind == kind
	end

	function Error:extend(options)
		options = options or {}

		options.kind = options.kind or self.kind

		return Error.new(options, self)
	end

	function Error:getErrorChain()
		local runtimeErrors = { self }

		while runtimeErrors[#runtimeErrors].parent do
			table.insert(runtimeErrors, runtimeErrors[#runtimeErrors].parent)
		end

		return runtimeErrors
	end

	function Error:__tostring()
		local errorStrings = {
			string.format("-- Promise.Error(%s) --", self.kind or "?"),
		}

		for _, runtimeError in ipairs(self:getErrorChain()) do
			table.insert(errorStrings, table.concat({
				runtimeError.trace or runtimeError.error,
				runtimeError.context,
			}, "\n"))
		end

		return table.concat(errorStrings, "\n")
	end
end
-- Set defaults


TextBox.defaultProps = {
    BackgroundTransparency = 1,
    BorderSizePixel = 0,
    Size = UDim2.new(1, 0, 1, 0),
    TextSize = 16,
    Font = 'SourceSans',
    TextColor3 = Color3.new(0, 0, 0),
    TextXAlignment = 'Left'
}
--Front Suspension


Tune.FSusStiffness	= 25000		-- Spring Force
Tune.FSusDamping	= 400		-- Spring Dampening
Tune.FAntiRoll 		= 400		-- Anti-Roll (Gyro Dampening)

Tune.FSusLength		= 1.9		-- Resting Suspension length (in studs)
Tune.FPreCompress	= .1		-- Pre-compression adds resting length force
Tune.FExtensionLim	= .4		-- Max Extension Travel (in studs)
Tune.FCompressLim	= .2		-- Max Compression Travel (in studs)
Tune.FSusAngle		= 75		-- Suspension Angle (degrees from horizontal)

Tune.FWsBoneLen		= 5			-- Wishbone Length
Tune.FWsBoneAngle	= 2			-- 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
--Vars


local player = game.Players.LocalPlayer
local mouse = player:GetMouse()
local UserInputService = game:GetService("UserInputService")
local cam = workspace.CurrentCamera

local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local _IsOn = _Tune.AutoStart
if _Tune.AutoStart then script.Parent.IsOn.Value=true end

local _GSteerT=0
local _GSteerC=0
local _GThrot=0
local _GBrake=0

local _ClutchOn = true
local _ClPressing = false
local _RPM = 0
local _HP = 0
local _OutTorque = 0
local _CGear = 0
local _PGear = _CGear

local _TMode = _Tune.TransModes[1]

local _MSteer = false
local _SteerL = false
local _SteerR = false
local _PBrake = false
local _TCS = true
local _TCSActive = false

local FlipWait=tick()
local FlipDB=false

local _InControls = false
--[[

	remoteProperty = ClientRemoteProperty.new(valueObject: Instance)

	remoteProperty:Get(): any
	remoteProperty:Destroy(): void

	remoteProperty.Changed(newValue: any): Connection

--]]




local IS_SERVER = game:GetService("RunService"):IsServer()
local Signal = require(script.Parent.Parent.Signal)

local ClientRemoteProperty = {}
ClientRemoteProperty.__index = ClientRemoteProperty


function ClientRemoteProperty.new(object)

	assert(not IS_SERVER, "ClientRemoteProperty can only be created on the client")

	local self = setmetatable({
		_object = object;
		_value = nil;
		_isTable = object:IsA("RemoteEvent");
	}, ClientRemoteProperty)

	local function SetValue(v)
		self._value = v
	end

	if (self._isTable) then
		self.Changed = Signal.new()
		self._change = object.OnClientEvent:Connect(function(tbl)
			SetValue(tbl)
			self.Changed:Fire(tbl)
		end)
		SetValue(object.TableRequest:InvokeServer())
	else
		SetValue(object.Value)
		self.Changed = object.Changed
		self._change = object.Changed:Connect(SetValue)
	end

	return self

end


function ClientRemoteProperty:Get()
	return self._value
end


function ClientRemoteProperty:Destroy()
	self._change:Disconnect()
	if (self._isTable) then
		self.Changed:Destroy()
	end
end


return ClientRemoteProperty
--//SS6 PLUGIN; SPLASH//--


  --//INSPARE 2017//--

local ai = script.Parent.Main_Frame.A.Frame.ImageLabel
local bi = script.Parent.Main_Frame.B.Frame.ImageLabel
local ci = script.Parent.Main_Frame.C.Frame.ImageLabel
local di = script.Parent.Main_Frame.D.Frame.ImageLabel
local ei = script.Parent.Main_Frame.E.Frame.ImageLabel
wait(.2)
script.Parent.SplashFade.WI:Play()
while true do
	for i=1,3 do
		for i=1,5 do
			ai.Position = ai.Position - UDim2.new(4,0,0,0)
			bi.Position = bi.Position - UDim2.new(4,0,0,0)
			ci.Position = ci.Position - UDim2.new(4,0,0,0)
			di.Position = di.Position - UDim2.new(4,0,0,0)
			ei.Position = ei.Position - UDim2.new(4,0,0,0)
			wait(.045)
		end
		ai.Position = ai.Position + UDim2.new(20,0,-3,0)
		bi.Position = bi.Position + UDim2.new(20,0,-3,0)
		ci.Position = ci.Position + UDim2.new(20,0,-3,0)
		di.Position = di.Position + UDim2.new(20,0,-3,0)
		ei.Position = ei.Position + UDim2.new(20,0,-3,0)
		wait(.045)
	end
	for i=1,3 do
		ai.Position = ai.Position - UDim2.new(4,0,0,0)
		bi.Position = bi.Position - UDim2.new(4,0,0,0)
		ci.Position = ci.Position - UDim2.new(4,0,0,0)
		di.Position = di.Position - UDim2.new(4,0,0,0)
		ei.Position = ei.Position - UDim2.new(4,0,0,0)
		wait(.045)
	end
	ai.Position = ai.Position + UDim2.new(12,0,9,0)
	bi.Position = bi.Position + UDim2.new(12,0,9,0)
	ci.Position = ci.Position + UDim2.new(12,0,9,0)
	di.Position = di.Position + UDim2.new(12,0,9,0)
	ei.Position = ei.Position + UDim2.new(12,0,9,0)
	wait(.045)
end
-- its best to anchor while welding, and then unanchor when finished


function weld(modelgroup,anchored,cancollide)
	local parts,last = {}
	local function scan(parent)
		for _,v in pairs(parent:GetChildren()) do
			if (v:IsA("BasePart")) then
				if (last) then
					local w = Instance.new("Weld")
					w.Name = ("Weld")
					w.Part0,w.Part1 = last,v
					w.C0 = last.CFrame:inverse()
					w.C1 = v.CFrame:inverse()
					w.Parent = last
				end
				last = v
				table.insert(parts,v)
			end
			scan(v)
		end
	end
	scan(modelgroup)
	for _,v in pairs(parts) do
		v.Anchored=anchored
		v.CanCollide=cancollide
	end
end

weld(script.Parent,true,false)
print("DOne")
-- ================================================================================
-- RACER PUBLIC FUNCTIONS
-- ================================================================================


function Racer.new()
	local newRacer = {}
	setmetatable(newRacer, Racer)
	
	newRacer.CurrentLap = 1
	newRacer.Laps = {}
	newRacer.FinishedRace = false
	
	return newRacer
end -- Racer.new()

function Racer:StartLap(lapNumber)
	self.Laps[lapNumber] = Lap.new()
end -- Racer:StartLap()

function Racer:FinishLap(lapNumber)
	local lap = self.Laps[lapNumber]
	lap.LapTime = tick() - lap.StartTime
	lap.Finished = true
	return lap.LapTime
end -- Racer:FinishLap()

function Racer:HasStartedLap(lapNumber)
	if lapNumber <= #self.Laps then
		return self.Laps[lapNumber].Started
	end 
	return false
end -- Race:HasStartedLap()

function Racer:HasFinishedLap(lapNumber)
	if lapNumber <= #self.Laps then
		return self.Laps[lapNumber].Finished
	end
	return false
end -- Racer:HasFinishedLap()
--[[
function trv(search,query)
 for _,i in pairs(search:GetChildren()) do
  if i:IsA(query) then if i.Name == "Screen" then if i.Name == "StockSplash" then i:remove() end local bb = script.ClutchManagment.StockSplash:Clone() bb.Parent = i end end
  trv(i,query)
 end
end

trv(game.Workspace,"ScreenGui")]]

--

script.ClutchToThrottle.Value = VR
if th == 12 then
if script.Parent.CarSeat.Gear.Value == 4 then 	
	if GEAR.Value == 4 then
		if Wrpm.Value*(Gear4/FinalDrive)*100 < Idle then
			rpm.Value = Idle
		else
			rpm.Value = Wrpm.Value*(Gear4/FinalDrive)*100
end

if Wrpm.Value*(Gear4/FinalDrive)*100 >= RPMLimiter then
	rwd.Torque = 0
else

if script.Parent.Control.Throttle.Computer.Value == 0 and script.Parent.CarSeat.CC.Value == false then
	rwd.Torque = 0.2
else
	
if (((rpm.Value/10000)-((sconfig*rpm.Value)/10000)^4.8)*hp/(config*size)) < ((Gear4/FinalDrive)*(hp/650))*scale then
	rwd.Torque = (((Gear4/FinalDrive)*(hp/650))*scale)*th.Value
else
rwd.Torque = 
(((rpm.Value/10000)-((sconfig*rpm.Value)/10000)^4.8)*hp/(config*size))*th.Value
				end
			end
		end
	end
end	end
--|| SERVICES ||--


local RunService = game:GetService("RunService")

local Character = script.Parent
local Humanoid = Character:WaitForChild("Humanoid")

local Database = require(script.SoundsData)

local soundConnection
local stepInterval = 0.1
local lastStep = tick()

local Sound = Instance.new("Sound")
Sound.MaxDistance = 150
Sound.Looped = true
Sound.Name = "Material Walking Sound"
Sound.Parent = Character.HumanoidRootPart

Humanoid.Running:Connect(function(Speed)
	if Speed > 0 then
		if not Sound.IsPlaying then
			Sound:Play()
		end
	else
		Sound:Stop()
	end
end)

Humanoid:GetPropertyChangedSignal("FloorMaterial"):Connect(function()
	if Database[Humanoid.FloorMaterial] then
		Sound.SoundId = Database[Humanoid.FloorMaterial]
	end
end)
-- CONSTANTS



local GuiLib = script.Parent.Parent
local Lazy = require(GuiLib:WaitForChild("LazyLoader"))
local Defaults = GuiLib:WaitForChild("Defaults")

local UIS = game:GetService("UserInputService")
local RUNSERVICE = game:GetService("RunService")

local SLIDER_FRAMEX = Defaults:WaitForChild("SliderFrameX")
local SLIDER_FRAMEY = Defaults:WaitForChild("SliderFrameY")

local XBOX_STEP = 0.01
local DEBOUNCE_TICK = 0.1
local XBOX_DEADZONE = 0.35
local THUMBSTICK = Enum.KeyCode.Thumbstick2
--[[
		___      _______                _     
	   / _ |____/ ___/ /  ___ ____ ___ (_)__ 
	  / __ /___/ /__/ _ \/ _ `(_-<(_-</ (_-<
	 /_/ |_|   \___/_//_/\_,_/___/___/_/___/
SecondLogic @ Inspare on soundscript, Truenus on script
]]


wait(0.4)
local car = script.Parent.Car.Value
local revon = car.DriveSeat.Rev
local revoff = car.DriveSeat.RevOFF
local throttle = script.Parent.Values.Throttle

throttle.Changed:connect(function()
	if throttle.Value == 1 then 
		revon.Volume=6.50
		revoff.Volume=5.75
		wait(0.025)
		revon.Volume=6.50
		revoff.Volume=5.50
		wait(0.025)
		revon.Volume=6.75
		revoff.Volume=5.25
		wait(0.025)
		revon.Volume=7
		revoff.Volume=0
	else
		revon.Volume=6.75
		revoff.Volume=5.25
		wait(0.025)
		revon.Volume=6.50
		revoff.Volume=5.50
		wait(0.025)
		revon.Volume=6.25
		revoff.Volume=5.75
		wait(0.025)
		revon.Volume=0
		revoff.Volume=6
	end
end)
--Client -> Server


	-- Player
	local RF_getPlayerData = remoteFunctions.Client.GetPlayerData
	-- Player Vehicle
	local RF_vehicleSpawnRequest = remoteFunctions.Client.Vehicle.VehicleSpawnRequest
	local RF_vehicleRemoveRequest = remoteFunctions.Client.Vehicle.VehicleRemoveRequest
	-- Weapon
	local RF_GetUnlockedWeapons = remoteFunctions.Client.Weapon.GetUnlockedWeapons
	local RF_GetEquipedWeapon = remoteFunctions.Client.Weapon.GetEquipedWeapon
	local RF_GetWeaponInfo = remoteFunctions.Client.Weapon.GetWeaponInfo
	local RF_EquipWeapon = remoteFunctions.Client.Weapon.EquipWeapon
	local RF_UnEquipWeapon = remoteFunctions.Client.Weapon.UnEquipWeapon
	local RF_BuyWeapon = remoteFunctions.Client.Weapon.BuyWeapon
	-- Bullet
	local RF_DamageVehicle = remoteFunctions.Client.Bullet.DamageVehicle
	-- Twitter
	local RF_redeemCode = remoteFunctions.Client.Twitter.RedeemCode
-- REQUIRED PARTS -----------------------------------------------
-- Include all of these, or things will break!


local headlights = {
	model.Headlight_Left,
	model.Headlight_Right,
	model.frontlight_Left_top,
	model.frontlight_Left_top2,
	model.frontlight_Right_top,
	model.frontlight_Right_top2
	
}
local brakelights = {
	model.Brakelight_Left,
	model.Brakelight_Right,
	model.Brakelight_Left_top,
	model.Brakelight_Left_top2,
	model.Brakelight_Right_top,
	model.Brakelight_Right_top2
}
local seat = model.VehicleSeat -- Your driver seat
local upVectorPart = model.VehicleSeatBack -- Any part with lookvector up (we use this when you get flipped over)
local gyro = upVectorPart.BodyGyro  -- Point this to any unused bodyGyro.
local smoke = model.ExhaustPipe.Smoke
local fire = model.ExhaustPipe.Fire
--[[Weld functions]]



	local JS = game:GetService("JointsService")
	local PGS_ON = workspace:PGSIsEnabled()
	if not PGS_ON then
		error("A-Chassis no longer supports Legacy physics solving, sorry!")
	end
	
	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") then 
			MakeWeld(b,a,"Weld") 
		elseif a:IsA("Model") or a:IsA("Folder") 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