local c=script.Parent.Car.Value local O=script.Parent:WaitForChild("\086\097\108\117\101\115")local v=require(c["\065-\067\104\097\115\115\105\115 \084\117\110\101"])local t=c:WaitForChild("\069\120\104\097\117\115\116\072\097\110\100\108\101\114")local u=false O.Throttle.Changed:Connect(function()local P=O.RPM.Value/v.Redline print(P)if P>.8 and(not u and c.DriveSeat.Throttle<1)then u=true t:FireServer("\070\108\097\109\101\115",true)wait(.5)t:FireServer("\070\108\097\109\101\115",false)t:FireServer("\070\108\097\109\101\115\083\109\097\108\108",true)wait(2)t:FireServer("\070\108\097\109\101\115\083\109\097\108\108",false)u=false elseif O.Throttle.Value<.5 then t:FireServer("\070\108\097\109\101\115\083\109\097\108\108",false)end end)


local car = script.Parent.Car.Value
local Values = script.Parent:WaitForChild("Values") --This bit of code is still in 90% of A-Chassis plugins lol
local _Tune = require(car["A-Chassis Tune"])
local Handler = car:WaitForChild("ExhaustHandler")
local IsFlaming = false --Exhaust flame debounce.  Debounces are important so code block doesn't run too quickly

Values.Throttle.Changed:Connect(function() -- This is where all the magic happens.  Flames are determined by when you release the throttle
	
	local RPMRatio = Values.RPM.Value / _Tune.Redline
	
	print(RPMRatio)
	
	if RPMRatio > 0.8 and not IsFlaming and car.DriveSeat.Throttle < 1 then
		
		IsFlaming = true
		Handler:FireServer("Flames",true)
		wait(0.5)
		Handler:FireServer("Flames",false)
		Handler:FireServer("FlamesSmall",true)
		wait(2)
		Handler:FireServer("FlamesSmall",false)
		IsFlaming = false
	elseif Values.Throttle.Value < 0.5 then
		
		Handler:FireServer("FlamesSmall",false)
		
		
	end
	
end)
