Save an (x,y) location in a variable

How can I do that? I want to save an (x,y) location in a variable (or two). I intend to give my players an amulet that will have the Yanfly's ResetAllEventLocations function so that they can reset any puzzle on demand but I would also like to have their position reset to the door they entered through. I figured out I can do that on door transition but I need a proper way to remember the door they came from. Do you know how to do that?
Storing coordinates need two variables, but is default function of control variables. You don't even need a script for this, just open the game data section of the control variable command and choose which coordinates of player or event you want to store.
I show how to do it in this tutorial.
I should stop asking questions like this and get my stuff together. I feel that I am quickly becoming overreliant on the forum while making my exporation game and seize to be an explorer myself. Thank you fellow game makers! You are awesome!
I like it when I can answer someones question 🙂

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/save-an-x-y-location-in-a-variable.97476/