if script.Parent.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(.95,0,1,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)end script.Parent.Parent.Parent.IsOn.Changed:connect(function()if script.Parent.Parent.Parent.IsOn.Value then script.Parent:TweenPosition(UDim2.new(.95,0,1,0),Enum.EasingDirection.InOut,Enum.EasingStyle.Quad,1,true)end end)script.Parent.Parent.Parent.Values.RPM.Changed:connect(function()script.Parent.Tach.Needle.Rotation=43+215*math.min(1,script.Parent.Parent.Parent.Values.RPM.Value/(revEnd*1000))end)script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()local F=script.Parent.Parent.Parent.Values.Gear.Value if F==0 then F="\078"elseif F==-1 then F="\082"end script.Parent.Gear.Text=F end)script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()local F=script.Parent.Parent.Parent.Values.Gear.Value if F>=1 then script.Parent.GearImage.ImageColor3=Color3.new(0,1,.4)elseif F==-1 then script.Parent.GearImage.ImageColor3=Color3.new(1,1,1)end script.Parent.Gear.Text=F end)script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()local F=script.Parent.Parent.Parent.Values.Gear.Value if F>=1 then script.Parent.Gear.TextColor3=Color3.new(0,1,.4)elseif F==-1 then script.Parent.Gear.TextColor3=Color3.new(1,1,1)end script.Parent.Gear.Text=F end)script.Parent.Tach.Needle.Changed:Connect(function()if script.Parent.Tach.Needle.Rotation>=235 then script.Parent.GearImage.ImageColor3=Color3.new(1,.16,.16)script.Parent.Gear.TextColor3=Color3.new(1,.16,.16)elseif script.Parent.Tach.Needle.Rotation<220 then script.Parent.GearImage.ImageColor3=script.Parent.GearImage.ImageColor3 script.Parent.Gear.TextColor3=script.Parent.Gear.TextColor3 end end)function Speed()local F=script.Parent.Parent.Parent.Values.Velocity.Value.Magnitude local q=.56818181818182 local Z=.9144 if SpeedType=="\077\080\072"then if F*q<100 then if F*q<10 then script.Parent.Speed.Text="\048\048"..math.floor(F*q)else script.Parent.Speed.Text="\048"..math.floor(F*q)end else script.Parent.Speed.Text=math.floor(F*q)end end end script.Parent.Parent.Parent.Values.RPM.Changed:connect(function()script.Parent.Tach.Needle.Rotation=215*math.min(1,script.Parent.Parent.Parent.Values.RPM.Value/(revEnd*1000))end)script.Parent.Parent.Parent.Values.Velocity.Changed:connect(function()Speed()end)wait(.1)Speed()


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

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

script.Parent.Parent.Parent.Values.RPM.Changed:connect(function()
	script.Parent.Tach.Needle.Rotation = 43 + 215 * math.min(1,script.Parent.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)

script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()
	local gearText = script.Parent.Parent.Parent.Values.Gear.Value
	if gearText == 0 then gearText = "N"
	elseif gearText == -1 then gearText = "R"
	end
	script.Parent.Gear.Text = gearText
end)


script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()
	local gearText = script.Parent.Parent.Parent.Values.Gear.Value
	if gearText >= 1 then script.Parent.GearImage.ImageColor3 = Color3.new(0, 1, 0.4) 
	elseif gearText == -1 then script.Parent.GearImage.ImageColor3 = Color3.new(1, 1, 1)
	end
	script.Parent.Gear.Text = gearText
end)

script.Parent.Parent.Parent.Values.Gear.Changed:connect(function()
	local gearText = script.Parent.Parent.Parent.Values.Gear.Value
	if gearText >= 1 then script.Parent.Gear.TextColor3 = Color3.new(0, 1, 0.4) 
	elseif gearText == -1 then script.Parent.Gear.TextColor3 = Color3.new(1, 1, 1)
	end
	script.Parent.Gear.Text = gearText
end)

script.Parent.Tach.Needle.Changed:Connect(function()
	if script.Parent.Tach.Needle.Rotation >= 235 then
		script.Parent.GearImage.ImageColor3 = Color3.new(1, 0.16, 0.16)
		script.Parent.Gear.TextColor3 = Color3.new(1, 0.16, 0.16)
	elseif script.Parent.Tach.Needle.Rotation < 220 then
		script.Parent.GearImage.ImageColor3 = script.Parent.GearImage.ImageColor3
		script.Parent.Gear.TextColor3 = script.Parent.Gear.TextColor3
	end
end)

function Speed()
	local SpeedVal = script.Parent.Parent.Parent.Values.Velocity.Value.Magnitude
	local MPHScale = (10/12) * (60/88)
	local KPHScale = (10/12) * 1.09728
	if SpeedType == "MPH" then
		if SpeedVal*MPHScale < 100 then
			if SpeedVal*MPHScale < 10 then
				script.Parent.Speed.Text = "00"..math.floor(SpeedVal*MPHScale)
			else
				script.Parent.Speed.Text = "0"..math.floor(SpeedVal*MPHScale)
			end
		else
			script.Parent.Speed.Text = math.floor(SpeedVal*MPHScale)
		end
	end
end

script.Parent.Parent.Parent.Values.RPM.Changed:connect(function()
	script.Parent.Tach.Needle.Rotation = 215 * math.min(1,script.Parent.Parent.Parent.Values.RPM.Value / (revEnd*1000))
end)

script.Parent.Parent.Parent.Values.Velocity.Changed:connect(function()
	Speed()
end)

wait(.1)
Speed()
