Anonymous

In-game Functions: Difference between revisions

From Melvor Idle
m
Changed "fire" to "first" in the first example for unlocking pets.
m (Changed "fire" to "first" in the first example for unlocking pets.)
Tag: visualeditor
Line 252: Line 252:
  game.petManager.unlocked.delete(game.pets.getObjectByID('melvorD:CoolRock'));game.petManager.computeProvidedStats();
  game.petManager.unlocked.delete(game.pets.getObjectByID('melvorD:CoolRock'));game.petManager.computeProvidedStats();
  </syntaxhighlight>
  </syntaxhighlight>
The fire line will result in the unlocking of {{PetIcon|Cool Rock}} while the second line will remove the Cool Rock then reload the player's stats.
The first line will result in the unlocking of {{PetIcon|Cool Rock}} while the second line will remove the Cool Rock then reload the player's stats.
<syntaxhighlight lang="js">game.pets.forEach(pet => game.petManager.unlockPet(pet));</syntaxhighlight>
<syntaxhighlight lang="js">game.pets.forEach(pet => game.petManager.unlockPet(pet));</syntaxhighlight>
The above code will unlock every single pet.
The above code will unlock every single pet.