rcar $car = get scriptowner car
float $maxspeed = 180.0
float $curspeed = 0.0
float $unthrottle = 1.0
float $throttle = 0.0
float $throttlerate = 0.0004 // 100% unthrottle in 1 second is 0.001, 50%/sec is 0.0005 etc.
float $unitconv = 3600.0/1000.0 // tacho reads in m/s, this converts to km/h
while 1
{
  $curspeed = (get $car tachovelocity)*$unitconv
  $throttle = get $car throttle
  if $curspeed > $maxspeed
  {
    $unthrottle = $unthrottle - $throttlerate
  }
  else if $unthrottle < 1.0
  {
    $unthrottle = $unthrottle + $throttlerate
  }
  // disable so I can do speed runs.
  set $car throttle $throttle*$unthrottle
  interrupt
}