VXAce World Shifting Script

I need a world shifting script.

There are multiple maps(worlds). When you activate a world gem(item) it will shift to the world it is linked to. I need a script that lets you shift to the same coords.

Let's say in one world you're at 011,011. When you shift, you'd be in another world(map) but at the same coords of 011,011. Need it so that it can shift you if you're standing, or in a vehicle. If in a vehicle, the vehicle shifts too. Also need it so that if you shift into a lava field, or something lethal, you then get a game over screen.
no need for a script, that can easily be evented.

just attach a common event to the item, have that event use control variable to detect the current location and then transfer to the same coordinates on whatever other map you want to target.
then use get location info on the new position to decide whether to game over or not.
no need for a script, that can easily be evented.

just attach a common event to the item, have that event use control variable to detect the current location and then transfer to the same coordinates on whatever other map you want to target.
then use get location info on the new position to decide whether to game over or not.

I can't figure out how to do that now.🙁
control variable "posX" : game data : Player X position
control variable "posY" : game data : Player Y position
control variable "target map" = ID of target map (whatever map you want it to transfer to)
transfer player (using variables above)
get location info (using posX, posY from above) "infovariable" = Tile ID Layer 1 (or region ID if there are too many different tiles and you'll have to mark the death tiles with a region)
conditional branch if infovariable = xy then game over

Original thread: https://forums.rpgmakerweb.com/threads/world-shifting-script.179955/