GetCurrentZone

From Spheriki

Jump to: navigation, search

Get the index of the current zone in a zone script.


Contents

Usage

number GetCurrentZone();
  • number is returned, which is the index of the current zone.


Examples

Here is a zone script which will cause the player to randomly end the game with the zone's coordinates when they walk over it.

if (Math.floor(Math.random() * 10) === 0) {
  // U R DED LOLZ!
  var z = GetCurrentZone();
  var str = "You died at ";
  str += "(" + GetZoneX(z) + ", " + GetZoneY(z) + ").\n";
  str += "Game over.\n";
  Abort(str);
}


Notes

  • This function is best called within a zone script.


See also

Personal tools