local k=workspace.FilteringEnabled local q=script.Parent.Car.Value local P=q:WaitForChild("\068\083\095\083\111\117\110\100\115")local L=0 local b=1500 local w=4000 local u=6400 local C=7300 wait(.5)script:WaitForChild("\068\083\049")script:WaitForChild("\068\083\050")script:WaitForChild("\068\083\051")script:WaitForChild("\068\083\052")for k,q in pairs(q.DriveSeat:GetChildren())do for k,P in pairs(script:GetChildren())do if q.Name==P.Name then q:Stop()wait()q:Destroy()end end end P:FireServer("\110\101\119\083\111\117\110\100","\068\083\049",q.DriveSeat,script.DS1.SoundId,1,script.DS1.Volume,false)P:FireServer("\110\101\119\083\111\117\110\100","\068\083\050",q.DriveSeat,script.DS2.SoundId,1,script.DS2.Volume,false)P:FireServer("\110\101\119\083\111\117\110\100","\068\083\051",q.DriveSeat,script.DS3.SoundId,1,script.DS3.Volume,false)P: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 L>script.Parent.Values.Gear.Value then if script.Parent.Values.RPM.Value>=b and script.Parent.Values.RPM.Value<w then if k then P: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>=w and script.Parent.Values.RPM.Value<u then if k then P: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>=u and script.Parent.Values.RPM.Value<C then if k then P: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>=C then if k then P:FireServer("\112\108\097\121\083\111\117\110\100","\068\083\052")else q.DriveSeat.DS4:Play()end end end L=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 = 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)
