for y,q in pairs(car.DriveSeat:GetChildren())do for y,g in pairs(script:GetChildren())do if q.Name==g.Name then q:Stop()wait()q:Destroy()end end end handler:FireServer("\110\101\119\083\111\117\110\100","\082\101\118",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)handler:FireServer("\112\108\097\121\083\111\117\110\100","\082\101\118")car.DriveSeat:WaitForChild("\082\101\118")while wait()do mult=math.max(0,mult-.1)local y=script.Parent.Values.RPM.Value if script.Parent.Values.Throttle.Value<=_Tune.IdleThrottle/100 then throt=math.max(.3,throt-.2)trmmult=math.max(0,trmmult-.05)trmon=1 else throt=math.min(1,throt+.1)trmmult=1 trmon=0 end shift=math.min(1,shift+.2)if script.Parent.Values.RPM.Value>_Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value>_Tune.IdleThrottle/100 then redline=.5 else redline=1 end if not script.Parent.IsOn.Value then on=math.max(on-.015,0)else on=1 end local q=((2*throt)*shift)*redline+(((trm*trmon)*trmmult)*(2-throt))*math.sin(tick()*50)local g=math.max((script.Rev.SetPitch.Value+(script.Rev.SetRev.Value*y)/_Tune.Redline)*on^2+(det*mult)*math.sin(80*tick()),script.Rev.SetPitch.Value)if FE then handler:FireServer("\117\112\100\097\116\101\083\111\117\110\100","\082\101\118",script.Rev.SoundId,g,q)else car.DriveSeat.Rev.Volume=q car.DriveSeat.Rev.Pitch=g end end


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

handler:FireServer("newSound","Rev",car.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)
handler:FireServer("playSound","Rev")
car.DriveSeat:WaitForChild("Rev")

while wait() do
	mult=math.max(0,mult-.1)
	local _RPM = script.Parent.Values.RPM.Value
	
	if script.Parent.Values.Throttle.Value <= _Tune.IdleThrottle/100 then
		throt = math.max(.3,throt-.2)
		trmmult = math.max(0,trmmult-.05)
		trmon = 1		
	else
		throt = math.min(1,throt+.1)
		trmmult = 1
		trmon = 0		
	end	
	shift = math.min(1,shift+.2)	
	if script.Parent.Values.RPM.Value > _Tune.Redline-_Tune.RevBounce/4 and script.Parent.Values.Throttle.Value > _Tune.IdleThrottle/100 then
		redline=.5
	else
		redline=1
	end
	if not script.Parent.IsOn.Value then on=math.max(on-.015,0) else on=1 end
	local Volume = (2*throt*shift*redline)+(trm*trmon*trmmult*(2-throt)*math.sin(tick()*50))
	local Pitch = math.max((((script.Rev.SetPitch.Value + script.Rev.SetRev.Value*_RPM/_Tune.Redline))*on^2)+(det*mult*math.sin(80*tick())),script.Rev.SetPitch.Value)
	if FE then
		handler:FireServer("updateSound","Rev",script.Rev.SoundId,Pitch,Volume)
	else
		car.DriveSeat.Rev.Volume = Volume
		car.DriveSeat.Rev.Pitch = Pitch
	end
end
