EDIT TO CODE MADE SEE FOOTNOTE [FOOTNOTE]
Im Currently trying to work out how to make the game restart after players lives hit 0.
This ive managed to do. Game Over screen pops up and then i can hit restart.
The game then restarts From the beginning. Then i hit this issue once i either try to increase the score. or decrease life.

This is my current Restart button code
func _on_Restart_button_down():
global.score = 0
global.lives = 3
get_tree().reload_current_scene()
get_tree().paused = false
Im Having no issue with the scene reseting but this error only happens when i try to do the following/ IT also happens when i press the pause button:
func updatescore():
Score.text = str(global.score)
func updatelife():
Life.text = str(global.lives)
if global.lives == 0:
get_tree().paused = true
PlayPause.hide()
Overlay.show()
GameOver.show()
The Above Updates the global score or life var which is nothing more than:
var score = 0
var lives = 3
The second error line is just this line here:
GUI.updatelife()
Ive searched around but im not sure how to fix this issue?
Do i need to free the GUI Scene? Then re add it?
Ive tried this but, But none of the methods Ive tried Have worked.
Basically. After i restart the game the vars should reset And should play the game again like you would expect. With score updating and so on. Any help would be appreciated Thank you
[FOOTNOTE]
I Changed The restart button to this:
func _on_Restart_button_down():
global.score = 0
global.lives = 3
get_tree().reload_current_scene()
queue_free()
global.restart("res://Scenes/GUI.tscn")
Then in my global:
onready var currentScene = get_node("/root/Main/GUI")
func restart(scenePath):
#Free Scene
currentScene.queue_free()
#Instance Scene
var addScene = load(scenePath)
currentScene = addScene.instance()
get_tree().get_root().add_child(currentScene)
get_tree().paused = false
This Adds a GUI over the top which means the pause button now works BUT it still wont update the score. It hits me with an error.
How can i remove the GUI From The Tree so when its re instanced it works?