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

if not FE then
	for i,v in pairs(car.Body.WHEEL: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.Body.WHEEL
	end
	
	
	car.Body.WHEEL.Wheel:Play()
	
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		
car.Body.WHEEL.Wheel.Pitch = (car.Body.WHEEL.Wheel.SetPitch.Value + car.Body.WHEEL.Wheel.SetRev.Value*_RPM/_Tune.Redline)*on^2

		if _RPM == 700 then
	
			car.Body.WHEEL.Wheel.Volume = 0.1
	
			
		end

	end
else
	local handler = car.AC6_FE_Sounds
	
	handler:FireServer("newSound","Wheel",car.Body.WHEEL,script.Wheel.SoundId,0,script.Wheel.Volume,true)
	handler:FireServer("playSound","Wheel")
	
	local pitch4=0
	while wait() do
		local _RPM = script.Parent.Values.RPM.Value
		
		if not car.DriveSeat.IsOn.Value then on=math.max(on-.015,0) else on=1 end
		
		pitch4 = (script.Wheel.SetPitch.Value + script.Wheel.SetRev.Value*_RPM/_Tune.Redline)*on^2
	
		handler:FireServer("updateSound","Wheel",script.idle.SoundId,pitch4,script.Wheel.Volume)
	end
end


