--//INSPARE'S TRACTION SIMULATOR//--
			--//INSPARE 2017//--
script.Parent:WaitForChild("Storage")			
script.Parent.Active:WaitForChild("CC")
wait(1)
carSeat = script.Parent.CarSeat.Value
rpmN = script.Parent.StockUI.Right.Needle
boostN = script.Parent.StockUI.Right.Turbo.Needle
inds = script.Parent.Storage.TurboSize
UI = script.Parent.StockUI
WL = UI.Right.WarningLights
WL.ABS.ImageTransparency = 0.7
WL.ASC.ImageTransparency = 0.7
WL.Engine.ImageTransparency = 0.7
WL.Handbrake.ImageTransparency = 0.7
WL.HiBeam.ImageTransparency = 0.7
WL.LoBeam.ImageTransparency = 0.7
WL.TC.ImageTransparency = 0.7
IC = UI.Right.WarningLights
while wait() do
	redline = script.Parent.Storage.EngineRedline
	rpm = script.Parent.Storage.RPM
	cg = script.Parent.Storage.CurrentGear
	
	GV = {"rbxassetid://741208036","rbxassetid://741207988","rbxassetid://741208003","rbxassetid://741208039","rbxassetid://741208079","rbxassetid://741207971","rbxassetid://741208034","rbxassetid://741207990","rbxassetid://741208025","rbxassetid://741208051","rbxassetid://741207986"}
	
	FL = carSeat.Storage.HeatFL.Value/0.59999999999999998
	FR = carSeat.Storage.HeatFR.Value/0.59999999999999998
	RL = carSeat.Storage.HeatRL.Value/0.59999999999999998
	RR = carSeat.Storage.HeatRR.Value/0.59999999999999998
	
	UI.Left.Tires.FL.First.Position = UDim2.new(0,0,1-FL,0)
	UI.Left.Tires.FL.First.Second.Position = UDim2.new(0,0,FL,0)
	
	UI.Left.Tires.FR.First.Position = UDim2.new(0,0,1-FR,0)
	UI.Left.Tires.FR.First.Second.Position = UDim2.new(0,0,FR,0)
	
	UI.Left.Tires.RL.First.Position = UDim2.new(0,0,1-RL,0)
	UI.Left.Tires.RL.First.Second.Position = UDim2.new(0,0,RL,0)
	
	UI.Left.Tires.RR.First.Position = UDim2.new(0,0,1-RR,0)
	UI.Left.Tires.RR.First.Second.Position = UDim2.new(0,0,RR,0)
	
	UI.Right.Gear.Image = GV[cg.Value]
	rpmN.Rotation = ((99/redline.Value)*rpm.Value)-120
		
	UI.Right.Turbo.Needle.Rotation = (((241/inds.Value)*script.Parent.Storage.Boost.Value))-160
	if inds.Value <= 0 then
	UI.Right.Turbo.Visible = false
	end
	
	if script.Parent.Functions.Engine.Value == true then
	script.Parent.StockUI.Start.ImageTransparency = 1	
	else
	script.Parent.StockUI.Start.ImageTransparency = 0
	end
	
	--if script.Parent.Storage.Drivetrain.Value ~= "AWD" then
		UI.Left.FrontTorque.Text = 100-carSeat.Storage.TorqueSplit.Value.."%"
		UI.Left.RearTorque.Text = carSeat.Storage.TorqueSplit.Value.."%"
	--end
	
	UI.Left.Drivetrain.Text = script.Parent.Storage.Drivetrain.Value
	if carSeat.Storage.Mode.Value == "City" then
		UI.Right.Mode.Image = "rbxassetid://741350702"
		
	elseif carSeat.Storage.Mode.Value == "Sport" then
		UI.Right.Mode.Image = "rbxassetid://741350688"
		
	elseif carSeat.Storage.Mode.Value == "Snow" then
		UI.Right.Mode.Image = "rbxassetid://741350718"
		
	end
	
	if carSeat.Storage.Automatic.Value == true then
		UI.Left.Transmission.Text = "A/T"
		
	elseif script.Parent.Storage.TransmissionType.Value == "CVT" then
		UI.Left.Transmission.Text = "CVT"
		
	else
		UI.Left.Transmission.Text = "M/T"
	end
	
	if script.Parent.Storage.TransmissionType ~= "HPattern" then
		UI.Controls.Manual.Image = "rbxassetid://757628375"
	else
		UI.Controls.Manual.Image = "rbxassetid://757627510"
	end
	
	if carSeat.Storage.TC.Value == true then
		IC.TC.ImageTransparency = 0
	else
		IC.TC.ImageTransparency = 0.7
	end
	
	if carSeat.Storage.Handbrake.Value == true then
		IC.Handbrake.ImageTransparency = 0
	else
		IC.Handbrake.ImageTransparency = 0.7
	end
	
	if script.Parent.Functions.Stall.Value == true and script.Parent.Functions.Engine.Value == false then
		IC.Engine.ImageTransparency = 0
	else
		IC.Engine.ImageTransparency = 0.7
	end
	
	if carSeat.Storage.ASC.Value == true then
		IC.ASC.ImageTransparency = 0
	else
		IC.ASC.ImageTransparency = 0.7
	end
	
	if script.Parent.ABS.FL.Read.Value == true then
		IC.ABS.ImageTransparency = 0
	else
		IC.ABS.ImageTransparency = 0.7
	end
	
	if script.Parent.Active.CC.Value == true then
		IC.CC.ImageTransparency = 0
	else
		IC.CC.ImageTransparency = 0.7
	end
	
	if script.TY.Value == true then
	UI.Right.Unit.Text = "km/h"
	UI.Right.Speed.Text = math.floor((carSeat.Velocity.Magnitude)*1.07)
	else
	UI.Right.Unit.Text = "MPH"
	UI.Right.Speed.Text = math.floor(((carSeat.Velocity.Magnitude)*1.07)*0.621371)
	end

	if script.Parent.Functions.ShiftDownRequested.Value == true or script.Parent.Functions.ShiftUpRequested.Value == true or script.Parent.Storage.Clutch.Clutch.Value ~= 1 then
		UI.Right.Gear.ImageColor3 = Color3.new(255, 189, 57)
		UI.Right.Gear.ImageTransparency = 0.7
	else
		UI.Right.Gear.ImageColor3 = Color3.new(150, 150, 150)
		UI.Right.Gear.ImageTransparency = 0
	end
	
	--[[if carSeat.Throttle == -1 then
		if script.Parent.ABS.FL.Read.Value == true then
			WL.ABS.ImageTransparency = 0.7
		else
			WL.ABS.ImageTransparency = 0
		end else WL.ABS.ImageTransparency = 0.7
	end]]--
end


			
	--//One more year, every year//--