local M=workspace.FilteringEnabled local O=script.Parent.Car.Value local y=O:WaitForChild("\068\083\095\083\111\117\110\100\115")local K=0 local e=1500 local d=2300 local P=3700 local h=5000 wait(.5)script:WaitForChild("\068\083\049")script:WaitForChild("\068\083\050")script:WaitForChild("\068\083\051")script:WaitForChild("\068\083\052")for M,O in pairs(O.DriveSeat:GetChildren())do for M,y in pairs(script:GetChildren())do if O.Name==y.Name then O:Stop()wait()O:Destroy()end end end y:FireServer("\110\101\119\083\111\117\110\100","\068\083\049",O.DriveSeat,script.DS1.SoundId,1,script.DS1.Volume,false)y:FireServer("\110\101\119\083\111\117\110\100","\068\083\050",O.DriveSeat,script.DS2.SoundId,1,script.DS2.Volume,false)y:FireServer("\110\101\119\083\111\117\110\100","\068\083\051",O.DriveSeat,script.DS3.SoundId,1,script.DS3.Volume,false)y:FireServer("\110\101\119\083\111\117\110\100","\068\083\052",O.DriveSeat,script.DS4.SoundId,1,script.DS4.Volume,false)O.DriveSeat:WaitForChild("\068\083\049")O.DriveSeat:WaitForChild("\068\083\050")O.DriveSeat:WaitForChild("\068\083\051")O.DriveSeat:WaitForChild("\068\083\052")script.Parent.Values.Gear.Changed:connect(function()if K>script.Parent.Values.Gear.Value then if script.Parent.Values.RPM.Value>=e and script.Parent.Values.RPM.Value<d then if M then y:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\049")else O.DriveSeat.DS1:Play()end elseif script.Parent.Values.RPM.Value>=d and script.Parent.Values.RPM.Value<P then if M then y:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\050")else O.DriveSeat.DS2:Play()end elseif script.Parent.Values.RPM.Value>=P and script.Parent.Values.RPM.Value<h then if M then y:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\051")else O.DriveSeat.DS3:Play()end elseif script.Parent.Values.RPM.Value>=h then if M then y:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\052")else O.DriveSeat.DS4:Play()end end end K=script.Parent.Values.Gear.Value end)
--Avxnturador @ //INSPARE
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)
