local Q=workspace.FilteringEnabled local I=script.Parent.Car.Value local v=require(I["\065-\067\104\097\115\115\105\115 \084\117\110\101"])local X=0 script:WaitForChild("\082\101\118")if not Q then for Q,I in pairs(I.DriveSeat:GetChildren())do for Q,v in pairs(script:GetChildren())do if I.Name==v.Name then I:Stop()wait()I:Destroy()end end end for Q,v in pairs(script:GetChildren())do v.Parent=I.DriveSeat end I.DriveSeat.Rev:Play()while wait()do local Q=script.Parent.Values.RPM.Value if not script.Parent.IsOn.Value then X=math.max(X-.015,0)else X=1 end I.DriveSeat.Rev.Pitch=(I.DriveSeat.Rev.SetPitch.Value+(I.DriveSeat.Rev.SetRev.Value*Q)/v.Redline)*X^.5 end else local Q=I.AC6_FE_Sounds Q:FireServer("\110\101\119\083\111\117\110\100","\082\101\118",I.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)Q:FireServer("\112\108\097\121\083\111\117\110\100","\082\101\118")local M=0 while wait()do local I=script.Parent.Values.RPM.Value if not script.Parent.IsOn.Value then X=math.max(X-.015,0)else X=1 end M=(script.Rev.SetPitch.Value+(script.Rev.SetRev.Value*I)/v.Redline)*X^2 Q:FireServer("\117\112\100\097\116\101\083\111\117\110\100","\082\101\118",script.Rev.SoundId,M,script.Rev.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("Rev")

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
	
	car.DriveSeat.Rev:Play()
	
	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.Rev.Pitch = (car.DriveSeat.Rev.SetPitch.Value + car.DriveSeat.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^0.5
	end
else
	local handler = car.AC6_FE_Sounds
	handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
	handler:FireServer("playSound","Rev")
	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.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline)*on^2
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,pitch,script.Rev.Volume)
	end
end
