local e=workspace.FilteringEnabled local Q=script.Parent.Car.Value local o=Q:WaitForChild("\068\083\095\083\111\117\110\100\115")local H=0 local Z=1500 local M=4000 local D=6400 local t=7300 wait(.5)script:WaitForChild("\068\083\049")script:WaitForChild("\068\083\050")script:WaitForChild("\068\083\051")script:WaitForChild("\068\083\052")for e,Q in pairs(Q.DriveSeat:GetChildren())do for e,o in pairs(script:GetChildren())do if Q.Name==o.Name then Q:Stop()wait()Q:Destroy()end end end o:FireServer("\110\101\119\083\111\117\110\100","\068\083\049",Q.DriveSeat,script.DS1.SoundId,1,script.DS1.Volume,false)o:FireServer("\110\101\119\083\111\117\110\100","\068\083\050",Q.DriveSeat,script.DS2.SoundId,1,script.DS2.Volume,false)o:FireServer("\110\101\119\083\111\117\110\100","\068\083\051",Q.DriveSeat,script.DS3.SoundId,1,script.DS3.Volume,false)o:FireServer("\110\101\119\083\111\117\110\100","\068\083\052",Q.DriveSeat,script.DS4.SoundId,1,script.DS4.Volume,false)Q.DriveSeat:WaitForChild("\068\083\049")Q.DriveSeat:WaitForChild("\068\083\050")Q.DriveSeat:WaitForChild("\068\083\051")Q.DriveSeat:WaitForChild("\068\083\052")script.Parent.Values.Gear.Changed:connect(function()if H>script.Parent.Values.Gear.Value then if script.Parent.Values.RPM.Value>=Z and script.Parent.Values.RPM.Value<M then if e then o:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\049")else Q.DriveSeat.DS1:Play()end elseif script.Parent.Values.RPM.Value>=M and script.Parent.Values.RPM.Value<D then if e then o:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\050")else Q.DriveSeat.DS2:Play()end elseif script.Parent.Values.RPM.Value>=D and script.Parent.Values.RPM.Value<t then if e then o:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\051")else Q.DriveSeat.DS3:Play()end elseif script.Parent.Values.RPM.Value>=t then if e then o:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\052")else Q.DriveSeat.DS4:Play()end end end H=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 = 4000
local Rev3 = 6400
local Rev4 = 7300

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)
