GetCurrentZone
From Spheriki
Get the index of the current zone in a zone script.
Contents |
[edit]
Usage
number GetCurrentZone();
- number is returned, which is the index of the current zone.
[edit]
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);
}
[edit]
Notes
- This function is best called within a zone script.
[edit]
See also
- ExecuteZoneScript()
- GetNumZones()
- GetZoneHeight()
- GetZoneLayer()
- GetZoneWidth()
- GetZoneX()
- GetZoneY()
- SetZoneLayer()
- Abort()

