If you want to store vars like a players inventory between levels you can use an Singleton.
A singleton in Godot is a script that isn't attached to a scene. When its called to auto load in the project settings it will run before your scenes and stick around after they are closed allowing you to have global variables from scene to scene.
...
https://www.youtube.com/watch?v=jmI1G_VTjj4