local a=workspace.FilteringEnabled local z=script.Parent.Car.Value local d=require(z["\065-\067\104\097\115\115\105\115 \084\117\110\101"])local m=0 script:WaitForChild("\073\100\108\101")if not a then for a,z in pairs(z.DriveSeat:GetChildren())do for a,d in pairs(script:GetChildren())do if z.Name==d.Name then z:Stop()wait()z:Destroy()end end end for a,d in pairs(script:GetChildren())do d.Parent=z.DriveSeat end while wait()do local a=script.Parent.Values.RPM.Value if not script.Parent.IsOn.Value then m=math.max(m-.015,0)else m=1 end z.DriveSeat.Idle.Pitch=(z.DriveSeat.Idle.SetPitch.Value-(z.DriveSeat.Idle.SetRev.Value*a)/d.Redline)*m^2 end else local a=z.AC6_FE_Sounds a:FireServer("\110\101\119\083\111\117\110\100","\073\100\108\101",z.DriveSeat,script.Idle.SoundId,0,true)a:FireServer("\112\108\097\121\083\111\117\110\100","\073\100\108\101")local Q=0 while wait()do local z=script.Parent.Values.RPM.Value if not script.Parent.IsOn.Value then m=math.max(m-.015,0)else m=1 end Q=(script.Idle.SetPitch.Value-(script.Idle.SetRev.Value*z)/d.Redline)*m^2 a:FireServer("\117\112\100\097\116\101\083\111\117\110\100","\073\100\108\101",script.Idle.SoundId,Q,script.Idle.Volume)end end

local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local _Tune = require(car["A-Chassis Tune"])
local on = 0

script:WaitForChild("Idle")



if not FE then
	for i,v in pairs(car.DriveSeat:GetChildren()) do
		for _,a in pairs(script:GetChildren()) do
			if v.Name==a.Name then v:Stop() wait() v:Destroy() end
		end
	end
	for i,v in pairs(script:GetChildren()) do
		v.Parent=car.DriveSeat
	end
	
	
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
    car.DriveSeat.Idle.Pitch = (car.DriveSeat.Idle.SetPitch.Value - car.DriveSeat.Idle.SetRev.Value*_RPM/_Tune.Redline)*on^2
end
else
	local handler = car.AC6_FE_Sounds
	handler:FireServer("newSound","Idle",car.DriveSeat,script.Idle.SoundId,0,true)
	handler:FireServer("playSound","Idle")

	local pitch=0

	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		pitch = (script.Idle.SetPitch.Value - script.Idle.SetRev.Value*_RPM/_Tune.Redline)*on^2
		handler:FireServer("updateSound","Idle",script.Idle.SoundId,pitch,script.Idle.Volume)
	end
end
