{
  name: "Meta Man Randbats",
  desc: [
  "When a Pokemon faints, the opposing Pokemon replaces its current ability with the fainted Pokemon's and gains its last-used move in a new slot (for up to 9 total moves). These changes last the entire match. If a Pokemon faints before using a move during the match, no move is gained by the opponent.",
  "• <a href=\"http://www.smogon.com/forums/threads/meta-man.3565966/\">Meta Man</a>",
  ],
  team: 'random',
  ruleset: ['Team Preview', 'Random Battle'],
  section: "Randomized Metas",
  mod: "metaman",
  onFaint: function(pokemon) {
  this.add("-message", pokemon.side.foe.pokemon[0].name + " received " + pokemon.name + "'s " + this.data.Abilities[pokemon.ability].name + "!");
     pokemon.side.foe.pokemon[0].setAbility(pokemon.ability);
     pokemon.side.foe.pokemon[0].baseAbility = pokemon.ability;
  let lastMove = pokemon.lastM;
  let has
  if (pokemon.side.foe.pokemon[0].moveset.length <= 9 && lastMove && !pokemon.side.foe.pokemon[0].hasMove(lastMove.id)) {
  pokemon.side.foe.pokemon[0].moveset.push(lastMove);
  pokemon.side.foe.pokemon[0].baseMoveset.push(lastMove);
  this.add("-message", pokemon.side.foe.pokemon[0].name + " received " + pokemon.name + "'s " + pokemon.lastM.move + "!");
  }
  },
},