-- Decompiled with Visenya | https://targaryentech.com

wait(0.1)
local car = script.Parent.Car.Value
local handler = car.Backfire
while wait(0.1) do
  local randomability = math.random(1, 2)
  if script.Parent.Values.RPM.Value > 5000 and randomability <= 1 and script.Parent.Values.Throttle.Value < 0.05 then
    wait(0.03)
    wait(0.07)
  end
  handler:FireServer("Heat", math.max(math.min(car.Body.Exhaust.Hot1.Texture.Transparency + 0.005 * (script.Parent.Values.RPM.Value / 5000 * script.Parent.Values.Throttle.Value) - 0.003, 1), 0))
  handler:FireServer("Heat", math.max(math.min(car.Body.Exhaust.Hot1.Texture2.Transparency + 0.005 * (script.Parent.Values.RPM.Value / 5000 * script.Parent.Values.Throttle.Value) - 0.003, 1), 0))
  handler:FireServer("Heat", math.max(math.min(car.Body.Exhaust.Hot1.Texture3.Transparency + 0.005 * (script.Parent.Values.RPM.Value / 5000 * script.Parent.Values.Throttle.Value) - 0.003, 1), 0))
  handler:FireServer("Heat", math.max(math.min(car.Body.Exhaust.Hot1.Texture4.Transparency + 0.005 * (script.Parent.Values.RPM.Value / 5000 * script.Parent.Values.Throttle.Value) - 0.003, 1), 0))
  handler:FireServer("Heat", math.max(math.min(car.Body.Exhaust.Hot1.Texture5.Transparency + 0.005 * (script.Parent.Values.RPM.Value / 5000 * script.Parent.Values.Throttle.Value) - 0.003, 1), 0))
  handler:FireServer("Heat", math.max(math.min(car.Body.Exhaust.Hot1.Texture6.Transparency + 0.005 * (script.Parent.Values.RPM.Value / 5000 * script.Parent.Values.Throttle.Value) - 0.003, 1), 0))
  if car.Body.Exhaust.Hot1.Texture.Transparency > 0.9 then
    car.Body.Exhaust.Hot1.Texture2.Transparency = 0.9
    car.Body.Exhaust.Hot1.Texture3.Transparency = 0.9
    car.Body.Exhaust.Hot1.Texture4.Transparency = 0.9
    car.Body.Exhaust.Hot1.Texture5.Transparency = 0.9
    car.Body.Exhaust.Hot1.Texture6.Transparency = 0.9
    value2 = NumberRange.new(5 * script.Parent.Values.Throttle.Value, 10 * script.Parent.Values.Throttle.Value)
    value3 = 100 * script.Parent.Values.Throttle.Value
    handler:FireServer("Sparks", true, value2, value3)
  else
    handler:FireServer("Sparks", false)
  end
end
