-- Decompiled with the Synapse X Luau decompiler.


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;
