I had a similar question when change scene, following is my solve:
Suppose I change scene from level1 scene to level2 scene.
[In Global autoload script]
var changeSceneFrom = null # only use when change scene
func arrive_new_scene(): # call this function in new scene.
func clear_changeSceneFrom(): # when things done keep variable null.
changeSceneFrom = null
[In Old Scene Script]
Global.changeSceneFrom = get_name()
[In New Scene Script]
Global.connect("change_scene", self, "_on_change_scene")
# The variable "Global.changeSceneFrom" has value when just change scene before, othewise it's null.
print("Change scene from " + Global.changeSceneFrom + " to ", get_name() + ".")
By the way, in my case both of level1 and level2 use the same script which contain all the codes in Old Scene Script and New Scene Script.
Finially, in my test it's works fine, and I got print like following:
Change scene from Level1 to Level2.
Hope this help.