local c=script.Parent.Car.Value local r=c:WaitForChild("\065\067\054\095\070\069\095\083\111\117\110\100\115")local p=require(c["\065-\067\104\097\115\115\105\115 \084\117\110\101"])local n=0 local x=0 local A=0 script:WaitForChild("\082\101\118")local d=0 local y=0 script.Parent.Values.Gear.Changed:connect(function()d=1 if script.Parent.Values.RPM.Value>5000 then y=.2 end end)for c,r in pairs(c.DriveSeat:GetChildren())do for c,p in pairs(script:GetChildren())do if r.Name==p.Name then r:Stop()wait()r:Destroy()end end end r:FireServer("\110\101\119\083\111\117\110\100",true,"\082\101\118",c.DriveSeat,script.Rev.SoundId,0,script.Rev.Volume,true)r:FireServer("\112\108\097\121\083\111\117\110\100","\082\101\118")c.DriveSeat:WaitForChild("\082\101\118")while wait()do d=math.max(0,d-.1)if script.Parent.Values.Throttle.Value<=p.IdleThrottle/100 then local c=math.max(.6,-0.2)local r=math.max(0,-0.05)local p=1 else v11=math.min(1.1,.1)v12=1 v13=0 end y=math.min(1,y+.2)if p.Redline-p.RevBounce/4<script.Parent.Values.RPM.Value and p.IdleThrottle/100<script.Parent.Values.Throttle.Value then local c=1 else v14=1 end if not script.Parent.IsOn.Value then n=math.max(n-.015,0)else n=1 end r:FireServer("\117\112\100\097\116\101\083\111\117\110\100",true,"\082\101\118",script.Rev.SoundId,math.max((script.Rev.SetPitch.Value+(script.Rev.SetRev.Value*script.Parent.Values.RPM.Value)/p.Redline)*n^2+(x*d)*math.sin(80*tick()),script.Rev.SetPitch.Value),(0*y)*v14+(((A*v13)*0)*3)*math.sin(tick()*50))end


local l__Value__1 = script.Parent.Car.Value;
local l__AC6_FE_Sounds__2 = l__Value__1:WaitForChild("AC6_FE_Sounds");
local v3 = require(l__Value__1["A-Chassis Tune"]);
local v4 = 0;
local v5 = 0;
local v6 = 0;
script:WaitForChild("Rev");
local u1 = 0;
local u2 = 0;
script.Parent.Values.Gear.Changed:connect(function()
	u1 = 1;
	if script.Parent.Values.RPM.Value > 5000 then
		u2 = 0.2;
	end;
end);
for v7, v8 in pairs(l__Value__1.DriveSeat:GetChildren()) do
	for v9, v10 in pairs(script:GetChildren()) do
		if v8.Name == v10.Name then
			v8:Stop();
			wait();
			v8:Destroy();
		end;
	end;
end;
l__AC6_FE_Sounds__2:FireServer("newSound", true, "Rev", l__Value__1.DriveSeat, script.Rev.SoundId, 0, script.Rev.Volume, true);
l__AC6_FE_Sounds__2:FireServer("playSound", "Rev");
l__Value__1.DriveSeat:WaitForChild("Rev");
while wait() do
	u1 = math.max(0, u1 - 0.1);
	if script.Parent.Values.Throttle.Value <= v3.IdleThrottle / 100 then
		local v11 = math.max(0.6, 0 - 0.2);
		local v12 = math.max(0, 0 - 0.05);
		local v13 = 1;
	else
		v11 = math.min(1.1, 0 + 0.1);
		v12 = 1;
		v13 = 0;
	end;
	u2 = math.min(1, u2 + 0.2);
	if v3.Redline - v3.RevBounce / 4 < script.Parent.Values.RPM.Value and v3.IdleThrottle / 100 < script.Parent.Values.Throttle.Value then
		local v14 = 1;
	else
		v14 = 1;
	end;
	if not script.Parent.IsOn.Value then
		v4 = math.max(v4 - 0.015, 0);
	else
		v4 = 1;
	end;
	l__AC6_FE_Sounds__2:FireServer("updateSound", true, "Rev", script.Rev.SoundId, math.max((script.Rev.SetPitch.Value + script.Rev.SetRev.Value * script.Parent.Values.RPM.Value / v3.Redline) * v4 ^ 2 + v5 * u1 * math.sin(80 * tick()), script.Rev.SetPitch.Value), 1 * 0 * u2 * v14 + v6 * v13 * 0 * (3 - 0) * math.sin(tick() * 50));
end;
