if autoscaling then local R={}if _Tune.Config=="\070\087\068"or _Tune.Config=="\065\087\068"then if car.Wheels:FindFirstChild("\070\076")~=nil then table.insert(R,car.Wheels.FL)end if car.Wheels:FindFirstChild("\070\082")~=nil then table.insert(R,car.Wheels.FR)end if car.Wheels:FindFirstChild("\070")~=nil then table.insert(R,car.Wheels.F)end end if _Tune.Config=="\082\087\068"or _Tune.Config=="\065\087\068"then if car.Wheels:FindFirstChild("\082\076")~=nil then table.insert(R,car.Wheels.RL)end if car.Wheels:FindFirstChild("\082\082")~=nil then table.insert(R,car.Wheels.RR)end if car.Wheels:FindFirstChild("\082")~=nil then table.insert(R,car.Wheels.R)end end local U=0 for R,m in pairs(R)do if m.Size.x>U then U=m.Size.x end end R=nil for R,m in pairs(UNITS)do m.maxSpeed=math.ceil((((((m.scaling*U)*math.pi)*_lRPM)/60)/_Tune.Ratios[#_Tune.Ratios])/_Tune.FinalDrive)m.spInc=math.max(math.ceil(m.maxSpeed/200)*20,20)end end for R=0,revEnd*2,1 do if R~=0 then local U=script.Parent.ln:clone()U.Parent=script.Parent.Tach U.Rotation=45+(R*225)/(revEnd*2)U.Num.Text=R/2 U.Num.Rotation=-U.Rotation if R*500>=math.floor(_pRPM/500)*500 then U.Frame.BackgroundColor3=Color3.new(1,0,0)if R<revEnd*2 then ln2=U:clone()ln2.Parent=script.Parent.Tach ln2.Rotation=45+((R+.5)*225)/(revEnd*2)ln2.Num:Destroy()ln2.Visible=true end end if R%2==0 then U.Frame.Size=UDim2.new(0,3,0,10)U.Frame.Position=UDim2.new(0,-1,0,100)U.Num.Visible=true else U.Num:Destroy()end U.Visible=true end end local R=Instance.new("\070\114\097\109\101",script.Parent.Speedo)R.Name="\108\110\115"R.BackgroundTransparency=1 R.BorderSizePixel=0 R.Size=UDim2.new(0,0,0,0)for U=1,90,1 do local m=script.Parent.ln:clone()m.Parent=R m.Rotation=45+225*(U/90)if U%2==0 then m.Frame.Size=UDim2.new(0,2,0,10)m.Frame.Position=UDim2.new(0,-1,0,100)end m.Num:Destroy()m.Visible=true end for R,U in pairs(UNITS)do local m=Instance.new("\070\114\097\109\101",script.Parent.Speedo)m.BackgroundTransparency=1 m.BorderSizePixel=0 m.Size=UDim2.new(0,0,0,0)m.Name=U.units if R~=1 then m.Visible=false end for R=0,U.maxSpeed,U.spInc do local A=script.Parent.ln:clone()A.Parent=m A.Rotation=45+225*(R/U.maxSpeed)A.Num.Text=R A.Num.TextSize=20 A.Num.Rotation=-A.Rotation A.Frame:Destroy()A.Num.Visible=true A.Visible=true end end function Gear()local R=script.Parent.Parent.Values.Gear.Value if script.Parent.Parent.Values.TransmissionMode.Value=="\065\117\116\111"then if(script.Parent.Parent:FindFirstChild("\068\114\105\118\101\077\111\100\101")).Value=="\067\111\109\102\111\114\116"then if R>0 then script.Parent.Tach.Gear.Text="\068"elseif R==0 then script.Parent.Tach.Gear.Text="\078"car.DriveSeat.FE_Lights:FireServer("\117\112\100\097\116\101\076\105\103\104\116\115","\114\101\118\101\114\115\101",false)elseif R==-1 then script.Parent.Tach.Gear.Text="\082"car.DriveSeat.FE_Lights:FireServer("\117\112\100\097\116\101\076\105\103\104\116\115","\114\101\118\101\114\115\101",true)end elseif(script.Parent.Parent:FindFirstChild("\068\114\105\118\101\077\111\100\101")).Value~="\067\111\109\102\111\114\116"then if R>0 then script.Parent.Tach.Gear.Text="\083"..R elseif R==0 then script.Parent.Tach.Gear.Text="\078"car.DriveSeat.FE_Lights:FireServer("\117\112\100\097\116\101\076\105\103\104\116\115","\114\101\118\101\114\115\101",false)elseif R==-1 then script.Parent.Tach.Gear.Text="\082"car.DriveSeat.FE_Lights:FireServer("\117\112\100\097\116\101\076\105\103\104\116\115","\114\101\118\101\114\115\101",true)end end elseif script.Parent.Parent.Values.TransmissionMode.Value~="\065\117\116\111"then if(script.Parent.Parent:FindFirstChild("\068\114\105\118\101\077\111\100\101")).Value~="\067\111\109\102\111\114\116"then if R>0 then script.Parent.Tach.Gear.Text="\077"..R elseif R==0 then script.Parent.Tach.Gear.Text="\078"car.DriveSeat.FE_Lights:FireServer("\117\112\100\097\116\101\076\105\103\104\116\115","\114\101\118\101\114\115\101",false)elseif R==-1 then script.Parent.Tach.Gear.Text="\082"car.DriveSeat.FE_Lights:FireServer("\117\112\100\097\116\101\076\105\103\104\116\115","\114\101\118\101\114\115\101",true)end elseif(script.Parent.Parent:FindFirstChild("\068\114\105\118\101\077\111\100\101")).Value=="\067\111\109\102\111\114\116"then if R>0 then script.Parent.Tach.Gear.Text=R elseif R==0 then script.Parent.Tach.Gear.Text="\078"car.DriveSeat.FE_Lights:FireServer("\117\112\100\097\116\101\076\105\103\104\116\115","\114\101\118\101\114\115\101",false)elseif R==-1 then script.Parent.Tach.Gear.Text="\082"car.DriveSeat.FE_Lights:FireServer("\117\112\100\097\116\101\076\105\103\104\116\115","\114\101\118\101\114\115\101",true)end end end end Gear()local U=false car.Electrics.Changed:Connect(function()if car.Electrics.Value==true then U=true local R=game:GetService("\084\119\101\101\110\083\101\114\118\105\099\101")local m=TweenInfo.new(1,Enum.EasingStyle.Quad,Enum.EasingDirection.Out,0,false)local A={}A.Rotation=270 local H=R:Create(script.Parent.Speedo.Needle,m,A)H:Play()H=R:Create(script.Parent.Tach.Needle,m,A)H:Play()local P={}P.Rotation=180 H=R:Create(intach,m,P)H:Play()H=R:Create(inspd,m,P)H:Play()wait(1)A.Rotation=45 H=R:Create(script.Parent.Speedo.Needle,m,A)H:Play()H=R:Create(script.Parent.Tach.Needle,m,A)H:Play()P.Rotation=-90 H=R:Create(intach,m,P)H:Play()H=R:Create(inspd,m,P)H:Play()wait(1)P.Rotation=45+225*math.min(1,script.Parent.Parent.Values.RPM.Value/(revEnd*1000))H=R:Create(script.Parent.Tach.Needle,m,P)H:Play()P.Rotation=45+225*math.min(1,(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude)/UNITS[currentUnits].maxSpeed)H=R:Create(script.Parent.Speedo.Needle,m,P)wait(1)U=false end end)car.DriveSeat.LI.Changed:connect(function()if car.DriveSeat.LI.Value==true then script.Parent.TMode.Left.Visible=true else script.Parent.TMode.Left.Visible=false end end)car.DriveSeat.RI.Changed:connect(function()if car.DriveSeat.RI.Value==true then script.Parent.TMode.Right.Visible=true else script.Parent.TMode.Right.Visible=false end end)if script.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)end script.Parent.Parent.IsOn.Changed:connect(function()if script.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(0,0,0,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)end end)function as()script.Parent.TMode.AS.Visible=car.ControlPanelHandler.Values.AS.Value end as()car.ControlPanelHandler.Values.AS.Changed:connect(as)function astog()script.Parent.TMode.AS2.Visible=not car.ControlPanelHandler.Values.ASTog.Value script.Parent.TMode.OFF.Visible=not car.ControlPanelHandler.Values.ASTog.Value end astog()car.ControlPanelHandler.Values.ASTog.Changed:connect(astog)script.Parent.Parent.Values.RPM.Changed:connect(function()if car.ControlPanelHandler.Values.AS.Value==false and U==false then script.Parent.Tach.Needle.Rotation=45+225*math.min(1,script.Parent.Parent.Values.RPM.Value/(revEnd*1000))intach.Rotation=-90+(script.Parent.Parent.Values.RPM.Value*270)/8000 else script.Parent.Tach.Needle.Rotation=60 end end)script.Parent.Parent.Values.Gear.Changed:connect(Gear)script.Parent.Parent.Values.TCS.Changed:connect(function()if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCS.Value then script.Parent.TCS.TextColor3=Color3.new(1,.66666666666667,0)script.Parent.TCS.TextStrokeColor3=Color3.new(1,.66666666666667,0)if script.Parent.Parent.Values.TCSActive.Value then wait()script.Parent.TCS.Visible=not script.Parent.TCS.Visible else wait()script.Parent.TCS.Visible=false end else script.Parent.TCS.Visible=true script.Parent.TCS.TextColor3=Color3.new(1,0,0)script.Parent.TCS.TextStrokeColor3=Color3.new(1,0,0)end else script.Parent.TCS.Visible=false end end)script.Parent.Parent.Values.TCSActive.Changed:connect(function()if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then wait()script.Parent.TCS.Visible=not script.Parent.TCS.Visible elseif not script.Parent.Parent.Values.TCS.Value then wait()script.Parent.TCS.Visible=true else wait()script.Parent.TCS.Visible=false end else script.Parent.TCS.Visible=false end end)script.Parent.TCS.Changed:connect(function()if _Tune.TCSEnabled then if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then wait()script.Parent.TCS.Visible=not script.Parent.TCS.Visible elseif not script.Parent.Parent.Values.TCS.Value then wait()script.Parent.TCS.Visible=true end else if script.Parent.TCS.Visible then script.Parent.TCS.Visible=false end end end)script.Parent.Parent.Values.ABS.Changed:connect(function()if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABS.Value then script.Parent.ABS.TextColor3=Color3.new(1,.66666666666667,0)script.Parent.ABS.TextStrokeColor3=Color3.new(1,.66666666666667,0)if script.Parent.Parent.Values.ABSActive.Value then wait()script.Parent.ABS.Visible=not script.Parent.ABS.Visible else wait()script.Parent.ABS.Visible=false end else script.Parent.ABS.Visible=true script.Parent.ABS.TextColor3=Color3.new(1,0,0)script.Parent.ABS.TextStrokeColor3=Color3.new(1,0,0)end else script.Parent.ABS.Visible=false end end)script.Parent.Parent.Values.ABSActive.Changed:connect(function()if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then wait()script.Parent.ABS.Visible=not script.Parent.ABS.Visible elseif not script.Parent.Parent.Values.ABS.Value then wait()script.Parent.ABS.Visible=true else wait()script.Parent.ABS.Visible=false end else script.Parent.ABS.Visible=false end end)script.Parent.ABS.Changed:connect(function()if _Tune.ABSEnabled then if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then wait()script.Parent.ABS.Visible=not script.Parent.ABS.Visible elseif not script.Parent.Parent.Values.ABS.Value then wait()script.Parent.ABS.Visible=true end else if script.Parent.ABS.Visible then script.Parent.ABS.Visible=false end end end)script.Parent.Parent.Values.PBrake.Changed:connect(function()script.Parent.PBrake.Visible=script.Parent.Parent.Values.PBrake.Value end)script.Parent.Parent.Values.TransmissionMode.Changed:connect(function()if script.Parent.Parent.Values.TransmissionMode.Value=="\065\117\116\111"then script.Parent.TMode.Text="\065\047\084"script.Parent.TMode.BackgroundColor3=Color3.new(1,.66666666666667,0)Gear()elseif script.Parent.Parent.Values.TransmissionMode.Value=="\083\101\109\105"then script.Parent.TMode.Text="\083\047\084"script.Parent.TMode.BackgroundColor3=Color3.new(0,.66666666666667,.49803921568627)Gear()else script.Parent.TMode.Text="\077\047\084"script.Parent.TMode.BackgroundColor3=Color3.new(1,.33333333333333,.5)Gear()end end)script.Parent.Parent.Values.Velocity.Changed:connect(function(R)if U==false then script.Parent.Speedo.Needle.Rotation=45+225*math.min(1,(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude)/UNITS[currentUnits].maxSpeed)script.Parent.Speedo.Speed.Text=math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude)inspd.Rotation=-90+1.6875*math.abs(script.Parent.Parent.Values.Velocity.Value.Magnitude*.56818181818182)end end)script.Parent.Speedo.Speed.MouseButton1Click:connect(function()if currentUnits==#UNITS then currentUnits=1 else currentUnits=currentUnits+1 end for R,U in pairs(script.Parent.Speedo:GetChildren())do U.Visible=U.Name==UNITS[currentUnits].units or U.Name=="\078\101\101\100\108\101"or U.Name=="\108\110\115"end script.Parent.Speedo.Speed.Unit.Text=UNITS[currentUnits].units end)mouse.KeyDown:connect(function(R)if R=="\118"then script.Parent.Visible=not script.Parent.Visible end end)

if autoscaling then
	local Drive={}
	if _Tune.Config == "FWD" or _Tune.Config == "AWD" then
		if car.Wheels:FindFirstChild("FL")~= nil then
			table.insert(Drive,car.Wheels.FL)
		end
		if car.Wheels:FindFirstChild("FR")~= nil then
			table.insert(Drive,car.Wheels.FR)
		end
		if car.Wheels:FindFirstChild("F")~= nil then
			table.insert(Drive,car.Wheels.F)
		end
	end
	if _Tune.Config == "RWD" or _Tune.Config == "AWD" then
		if car.Wheels:FindFirstChild("RL")~= nil then
			table.insert(Drive,car.Wheels.RL)
		end
		if car.Wheels:FindFirstChild("RR")~= nil then
			table.insert(Drive,car.Wheels.RR)
		end
		if car.Wheels:FindFirstChild("R")~= nil then
			table.insert(Drive,car.Wheels.R)
		end
	end

	local wDia = 0
	for i,v in pairs(Drive) do
		if v.Size.x>wDia then wDia = v.Size.x end
	end
	Drive = nil
	for i,v in pairs(UNITS) do
		v.maxSpeed = math.ceil(v.scaling*wDia*math.pi*_lRPM/60/_Tune.Ratios[#_Tune.Ratios]/_Tune.FinalDrive)
		v.spInc = math.max(math.ceil(v.maxSpeed/200)*20,20)
	end
end

for i=0,revEnd*2 do
	if i ~= 0 then
		local ln = script.Parent.ln:clone()
		ln.Parent = script.Parent.Tach
		ln.Rotation = 45 + i * 225 / (revEnd*2)
		ln.Num.Text = i/2
		ln.Num.Rotation = -ln.Rotation
		if i*500>=math.floor(_pRPM/500)*500 then
			ln.Frame.BackgroundColor3 = Color3.new(1,0,0)
			if i<revEnd*2 then
				ln2 = ln:clone()
				ln2.Parent = script.Parent.Tach
				ln2.Rotation = 45 + (i+.5) * 225 / (revEnd*2)
				ln2.Num:Destroy()
				ln2.Visible=true
			end
		end
		if i%2==0 then
			ln.Frame.Size = UDim2.new(0,3,0,10)
			ln.Frame.Position = UDim2.new(0,-1,0,100)
			ln.Num.Visible = true
		else
			ln.Num:Destroy()
		end
		ln.Visible=true
	end
end

local lns = Instance.new("Frame",script.Parent.Speedo)
lns.Name = "lns"
lns.BackgroundTransparency = 1
lns.BorderSizePixel = 0
lns.Size = UDim2.new(0,0,0,0)
for i=1,90 do
	local ln = script.Parent.ln:clone()
	ln.Parent = lns
	ln.Rotation = 45 + 225*(i/90)
	if i%2==0 then
		ln.Frame.Size = UDim2.new(0,2,0,10)
		ln.Frame.Position = UDim2.new(0,-1,0,100)
	end
	ln.Num:Destroy()
	ln.Visible=true
end

for i,v in pairs(UNITS) do
	local lnn = Instance.new("Frame",script.Parent.Speedo)
	lnn.BackgroundTransparency = 1
	lnn.BorderSizePixel = 0
	lnn.Size = UDim2.new(0,0,0,0)
	lnn.Name = v.units
	if i~= 1 then lnn.Visible=false end
	
	for i=0,v.maxSpeed,v.spInc do
		local ln = script.Parent.ln:clone()
		ln.Parent = lnn
		ln.Rotation = 45 + 225*(i/v.maxSpeed)
		ln.Num.Text = i
		ln.Num.TextSize = 20
		ln.Num.Rotation = -ln.Rotation
		ln.Frame:Destroy()
		ln.Num.Visible=true
		ln.Visible=true
	end
end

function Gear()
	local gearText = script.Parent.Parent.Values.Gear.Value
	if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
		if script.Parent.Parent:FindFirstChild("DriveMode").Value == "Comfort" then
			if gearText > 0 then 
				script.Parent.Tach.Gear.Text = "D"
			elseif gearText == 0 then
				script.Parent.Tach.Gear.Text = "N"
				car.DriveSeat.FE_Lights:FireServer('updateLights', 'reverse', false)
			elseif gearText == -1 then
				script.Parent.Tach.Gear.Text = "R"
				car.DriveSeat.FE_Lights:FireServer('updateLights', 'reverse', true)
			end
		elseif script.Parent.Parent:FindFirstChild("DriveMode").Value ~= "Comfort" then
			if gearText > 0 then 
				script.Parent.Tach.Gear.Text = "S"..gearText
			elseif gearText == 0 then
				script.Parent.Tach.Gear.Text = "N"
				car.DriveSeat.FE_Lights:FireServer('updateLights', 'reverse', false)
			elseif gearText == -1 then
				script.Parent.Tach.Gear.Text = "R"
				car.DriveSeat.FE_Lights:FireServer('updateLights', 'reverse', true)
			end			
		end
	elseif script.Parent.Parent.Values.TransmissionMode.Value ~= "Auto" then
		if script.Parent.Parent:FindFirstChild("DriveMode").Value ~= "Comfort" then
			if gearText > 0 then 
				script.Parent.Tach.Gear.Text = "M"..gearText
			elseif gearText == 0 then
				script.Parent.Tach.Gear.Text = "N"
				car.DriveSeat.FE_Lights:FireServer('updateLights', 'reverse', false)
			elseif gearText == -1 then
				script.Parent.Tach.Gear.Text = "R"
				car.DriveSeat.FE_Lights:FireServer('updateLights', 'reverse', true)
			end
		elseif script.Parent.Parent:FindFirstChild("DriveMode").Value == "Comfort" then
			if gearText > 0 then 
				script.Parent.Tach.Gear.Text = gearText
			elseif gearText == 0 then
				script.Parent.Tach.Gear.Text = "N"
				car.DriveSeat.FE_Lights:FireServer('updateLights', 'reverse', false)
			elseif gearText == -1 then
				script.Parent.Tach.Gear.Text = "R"
				car.DriveSeat.FE_Lights:FireServer('updateLights', 'reverse', true)
			end
		end
	end	
end

Gear()
local moving = false

car.Electrics.Changed:Connect(function()
	if car.Electrics.Value == true then
		moving = true
		local ts = game:GetService("TweenService")
		local tweenInfo = TweenInfo.new(1, Enum.EasingStyle.Quad, Enum.EasingDirection.Out, 0, false)
		local goal = {}
		goal.Rotation = 270
		
		local a = ts:Create(script.Parent.Speedo.Needle, tweenInfo, goal)
		a:Play()
		a = ts:Create(script.Parent.Tach.Needle, tweenInfo, goal)
		a:Play()
		local goal2 = {}
		goal2.Rotation = 180
		a = ts:Create(intach, tweenInfo, goal2)
		a:Play()
		a = ts:Create(inspd, tweenInfo, goal2)
		a:Play()
		wait(1)
		goal.Rotation = 45
		a = ts:Create(script.Parent.Speedo.Needle, tweenInfo, goal)
		a:Play()
		a = ts:Create(script.Parent.Tach.Needle, tweenInfo, goal)
		a:Play()
		goal2.Rotation = -90
		a = ts:Create(intach, tweenInfo, goal2)
		a:Play()
		a = ts:Create(inspd, tweenInfo, goal2)
		a:Play()
		wait(1)
		goal2.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
		a = ts:Create(script.Parent.Tach.Needle, tweenInfo, goal2)
		a:Play()
		goal2.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
		a = ts:Create(script.Parent.Speedo.Needle, tweenInfo, goal2)
		wait(1)
		moving = false
	end
end)

car.DriveSeat.LI.Changed:connect(function()
	if car.DriveSeat.LI.Value == true then
		script.Parent.TMode.Left.Visible = true
	else
		script.Parent.TMode.Left.Visible = false
	end
end)

car.DriveSeat.RI.Changed:connect(function()
	if car.DriveSeat.RI.Value == true then
		script.Parent.TMode.Right.Visible = true
	else
		script.Parent.TMode.Right.Visible = false
	end
end)

if 	script.Parent.Parent.IsOn.Value then
	script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
end

script.Parent.Parent.IsOn.Changed:connect(function()
	if script.Parent.Parent.IsOn.Value then
		script.Parent:TweenPosition(UDim2.new(0, 0, 0, 0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)
	end
end)

function as()
	script.Parent.TMode.AS.Visible = car.ControlPanelHandler.Values.AS.Value
end

as()

car.ControlPanelHandler.Values.AS.Changed:connect(as)

function astog()
	script.Parent.TMode.AS2.Visible = not car.ControlPanelHandler.Values.ASTog.Value
	script.Parent.TMode.OFF.Visible = not car.ControlPanelHandler.Values.ASTog.Value
end

astog()

car.ControlPanelHandler.Values.ASTog.Changed:connect(astog)

script.Parent.Parent.Values.RPM.Changed:connect(function()
	if car.ControlPanelHandler.Values.AS.Value == false and moving == false then
		script.Parent.Tach.Needle.Rotation = 45 + 225 * math.min(1,script.Parent.Parent.Values.RPM.Value / (revEnd*1000))
		intach.Rotation = -90 + script.Parent.Parent.Values.RPM.Value * 270 / 8000
	else
		script.Parent.Tach.Needle.Rotation = 60
	end
end)

script.Parent.Parent.Values.Gear.Changed:connect(Gear)


script.Parent.Parent.Values.TCS.Changed:connect(function()
	if _Tune.TCSEnabled then
		if script.Parent.Parent.Values.TCS.Value then
			script.Parent.TCS.TextColor3 = Color3.new(1,170/255,0)
			script.Parent.TCS.TextStrokeColor3 = Color3.new(1,170/255,0)
			if script.Parent.Parent.Values.TCSActive.Value then
				wait()
				script.Parent.TCS.Visible = not script.Parent.TCS.Visible
			else
				wait()
				script.Parent.TCS.Visible = false
			end
		else
			script.Parent.TCS.Visible = true
			script.Parent.TCS.TextColor3 = Color3.new(1,0,0)
			script.Parent.TCS.TextStrokeColor3 = Color3.new(1,0,0)
		end
	else
		script.Parent.TCS.Visible = false
	end
end)

script.Parent.Parent.Values.TCSActive.Changed:connect(function()
	if _Tune.TCSEnabled then
		if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
			wait()
			script.Parent.TCS.Visible = not script.Parent.TCS.Visible
		elseif not script.Parent.Parent.Values.TCS.Value then
			wait()
			script.Parent.TCS.Visible = true
		else
			wait()
			script.Parent.TCS.Visible = false
		end
	else
		script.Parent.TCS.Visible = false
	end
end)

script.Parent.TCS.Changed:connect(function()
	if _Tune.TCSEnabled then
		if script.Parent.Parent.Values.TCSActive.Value and script.Parent.Parent.Values.TCS.Value then
			wait()
			script.Parent.TCS.Visible = not script.Parent.TCS.Visible
		elseif not script.Parent.Parent.Values.TCS.Value then
			wait()
			script.Parent.TCS.Visible = true
		end
	else
		if script.Parent.TCS.Visible then
			script.Parent.TCS.Visible = false
		end
	end
end)

script.Parent.Parent.Values.ABS.Changed:connect(function()
	if _Tune.ABSEnabled then
		if script.Parent.Parent.Values.ABS.Value then
			script.Parent.ABS.TextColor3 = Color3.new(1,170/255,0)
			script.Parent.ABS.TextStrokeColor3 = Color3.new(1,170/255,0)
			if script.Parent.Parent.Values.ABSActive.Value then
				wait()
				script.Parent.ABS.Visible = not script.Parent.ABS.Visible
			else
				wait()
				script.Parent.ABS.Visible = false
			end
		else
			script.Parent.ABS.Visible = true
			script.Parent.ABS.TextColor3 = Color3.new(1,0,0)
			script.Parent.ABS.TextStrokeColor3 = Color3.new(1,0,0)
		end
	else
		script.Parent.ABS.Visible = false
	end
end)

script.Parent.Parent.Values.ABSActive.Changed:connect(function()
	if _Tune.ABSEnabled then
		if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
			wait()
			script.Parent.ABS.Visible = not script.Parent.ABS.Visible
		elseif not script.Parent.Parent.Values.ABS.Value then
			wait()
			script.Parent.ABS.Visible = true
		else
			wait()
			script.Parent.ABS.Visible = false
		end
	else
		script.Parent.ABS.Visible = false
	end
end)

script.Parent.ABS.Changed:connect(function()
	if _Tune.ABSEnabled then
		if script.Parent.Parent.Values.ABSActive.Value and script.Parent.Parent.Values.ABS.Value then
			wait()
			script.Parent.ABS.Visible = not script.Parent.ABS.Visible
		elseif not script.Parent.Parent.Values.ABS.Value then
			wait()
			script.Parent.ABS.Visible = true
		end
	else
		if script.Parent.ABS.Visible then
			script.Parent.ABS.Visible = false
		end
	end
end)

script.Parent.Parent.Values.PBrake.Changed:connect(function()
	script.Parent.PBrake.Visible = script.Parent.Parent.Values.PBrake.Value
end)

script.Parent.Parent.Values.TransmissionMode.Changed:connect(function()
	if script.Parent.Parent.Values.TransmissionMode.Value == "Auto" then
		script.Parent.TMode.Text = "A/T"
		script.Parent.TMode.BackgroundColor3 = Color3.new(1,170/255,0)
		Gear()
	elseif script.Parent.Parent.Values.TransmissionMode.Value == "Semi" then
		script.Parent.TMode.Text = "S/T"
		script.Parent.TMode.BackgroundColor3 = Color3.new(0, 170/255, 127/255) 
		Gear()
	else
		script.Parent.TMode.Text = "M/T"
		script.Parent.TMode.BackgroundColor3 = Color3.new(1,85/255,.5)
		Gear()
	end
end)

script.Parent.Parent.Values.Velocity.Changed:connect(function(property)
	if moving == false then
		script.Parent.Speedo.Needle.Rotation = 45 + 225 * math.min(1,UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude/UNITS[currentUnits].maxSpeed)
		script.Parent.Speedo.Speed.Text = math.floor(UNITS[currentUnits].scaling*script.Parent.Parent.Values.Velocity.Value.Magnitude)
		inspd.Rotation = -90 + (270 / 160) * (math.abs(script.Parent.Parent.Values.Velocity.Value.Magnitude*((10/12) * (60/88))))
	end
end)

script.Parent.Speedo.Speed.MouseButton1Click:connect(function()
	if currentUnits==#UNITS then
		currentUnits = 1
	else
		currentUnits = currentUnits+1
	end
	for i,v in pairs(script.Parent.Speedo:GetChildren()) do
		v.Visible=v.Name==UNITS[currentUnits].units or v.Name=="Needle" or v.Name=="lns"
	end
	script.Parent.Speedo.Speed.Unit.Text = UNITS[currentUnits].units
end)

mouse.KeyDown:connect(function(key)
	if key=="v" then
		script.Parent.Visible=not script.Parent.Visible
	end
end)

