local Q=workspace.FilteringEnabled local x=script.Parent.Car.Value local n=x:WaitForChild("\068\083\095\083\111\117\110\100\115")local Z=0 local N=1500 local g=2300 local T=3700 local y=5000 wait(.5)script:WaitForChild("\068\083\049")script:WaitForChild("\068\083\050")script:WaitForChild("\068\083\051")script:WaitForChild("\068\083\052")for Q,x in pairs(x.DriveSeat:GetChildren())do for Q,n in pairs(script:GetChildren())do if x.Name==n.Name then x:Stop()wait()x:Destroy()end end end n:FireServer("\110\101\119\083\111\117\110\100","\068\083\049",x.DriveSeat,script.DS1.SoundId,1,script.DS1.Volume,false)n:FireServer("\110\101\119\083\111\117\110\100","\068\083\050",x.DriveSeat,script.DS2.SoundId,1,script.DS2.Volume,false)n:FireServer("\110\101\119\083\111\117\110\100","\068\083\051",x.DriveSeat,script.DS3.SoundId,1,script.DS3.Volume,false)n:FireServer("\110\101\119\083\111\117\110\100","\068\083\052",x.DriveSeat,script.DS4.SoundId,1,script.DS4.Volume,false)x.DriveSeat:WaitForChild("\068\083\049")x.DriveSeat:WaitForChild("\068\083\050")x.DriveSeat:WaitForChild("\068\083\051")x.DriveSeat:WaitForChild("\068\083\052")script.Parent.Values.Gear.Changed:connect(function()if Z>script.Parent.Values.Gear.Value then if script.Parent.Values.RPM.Value>=N and script.Parent.Values.RPM.Value<g then if Q then n:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\049")else x.DriveSeat.DS1:Play()end elseif script.Parent.Values.RPM.Value>=g and script.Parent.Values.RPM.Value<T then if Q then n:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\050")else x.DriveSeat.DS2:Play()end elseif script.Parent.Values.RPM.Value>=T and script.Parent.Values.RPM.Value<y then if Q then n:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\051")else x.DriveSeat.DS3:Play()end elseif script.Parent.Values.RPM.Value>=y then if Q then n:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\052")else x.DriveSeat.DS4:Play()end end end Z=script.Parent.Values.Gear.Value end)

local FE = workspace.FilteringEnabled
local car = script.Parent.Car.Value
local handler = car:WaitForChild("DS_Sounds")
local lastGear = 0
local Rev1 = 1500
local Rev2 = 2300
local Rev3 = 3700
local Rev4 = 5000

wait(0.5)

script:WaitForChild("DS1")
script:WaitForChild("DS2")
script:WaitForChild("DS3")
script:WaitForChild("DS4")

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","DS1",car.DriveSeat,script.DS1.SoundId,1,script.DS1.Volume,false)
handler:FireServer("newSound","DS2",car.DriveSeat,script.DS2.SoundId,1,script.DS2.Volume,false)
handler:FireServer("newSound","DS3",car.DriveSeat,script.DS3.SoundId,1,script.DS3.Volume,false)
handler:FireServer("newSound","DS4",car.DriveSeat,script.DS4.SoundId,1,script.DS4.Volume,false)

car.DriveSeat:WaitForChild("DS1")
car.DriveSeat:WaitForChild("DS2")
car.DriveSeat:WaitForChild("DS3")
car.DriveSeat:WaitForChild("DS4")


script.Parent.Values.Gear.Changed:connect(function()
	if lastGear>script.Parent.Values.Gear.Value then
		if ((script.Parent.Values.RPM.Value>=Rev1) and (script.Parent.Values.RPM.Value<Rev2)) then
			if FE then handler:FireServer("playSound","DS1") else car.DriveSeat.DS1:Play() end
		elseif ((script.Parent.Values.RPM.Value>=Rev2) and (script.Parent.Values.RPM.Value<Rev3)) then
			if FE then handler:FireServer("playSound","DS2") else car.DriveSeat.DS2:Play() end
		elseif ((script.Parent.Values.RPM.Value>=Rev3) and (script.Parent.Values.RPM.Value<Rev4)) then
			if FE then handler:FireServer("playSound","DS3") else car.DriveSeat.DS3:Play() end
		elseif (script.Parent.Values.RPM.Value>=Rev4) then
			if FE then handler:FireServer("playSound","DS4") else car.DriveSeat.DS4:Play() end
		end
	end
	lastGear = script.Parent.Values.Gear.Value
end)
