Limit the number of nodes created from anonymous users
Drupal 8 invokes a specific hook when an entity is created: hook_entity_create_access(). Apart that, Drupal 8 code has been converted to a more OOP code, and it uses methods where before it used functions.
The following code is the one I would use for Drupal 8.
use Drupal\Core\Access\AccessResult;
use Drupal\Core\Session\AccountInterface;

/**
 * Implements hook_ENTITY_TYPE_create_access().
 */
function mymodule_node_create_access(AccountInterface $account, array $context, $entity_bundle) {
  $flood = \Drupal::flood();
  if ($entity_bundle == 'type_of_interest' &amp;&amp; $account-&gt;isAnonymous()) {
    if (!$flood-&gt;isAllowed('create_node', 2, 43200)) {
      return AccessResult::forbidden('There is a node creation limit of 2 nodes per 12 hours.');
    } 
    $flood-&gt;register('create_node', 43200);
  }
  return AccessResult::neutral();
}