Reset Global_variable

in Programming
My project is using quite a few variables as Global. So is there a way when I RESET the game, all those Global_scripts are back to the original as quickly as possible, everyone? Or do I have to manually reset it? Please support me.
Comments
So the best way would be to store the original values in a Dictionary. If you are using export variables to set the numbers, then in the _ready() function your would have to save them into the Dictionary. If it is just a couple values, then it would be easier to just use single variables, but if is more than 2 or 3, then a Dictionary is better.
This is the more advanced way to do it with Dictionaries:
I will watch and try to understand. Any questions I will ask you later. Thank you, Cyber!
Excuse me! Until now i still don't know how can i put the variable in the dictionary. I already know how to add key and value to dictionary. But putting variables into dictionary doesn't. For example I have 3 types of variables in Global_script:
var hello = true
var hello = 10
var yes_sir
so how do i put these 3 variables into the dictionary so that when i need it i can retrieve it as a default database? Pardon my slow understanding. Please help me. Thanks guys so much.
What do you mean by "putting a variable into a dictionary"? Dictionary is a collection of key-value pairs. They store values. If you need to group variables you can use custom classes.
Yeah, I mean I want to encode any variable into a dictionary key and value. And vice versa, when I need to use that variable, I will get it from that dictionary. What should I do?
My code posted above takes all the user-defined variables in the script and puts them in a Dictionary automatically. So it should work with all variables without changes.
Why? Simply use variables directly.
This is an extension of @cybereality answer, this is a more advanced solution where a variable defines the variables that can be reset and their default value
That's a good modification. Thanks.
Ok thank you so much everyone! I'll try to read much more to understand this. Because it is too difficult for me. But I will try to complete that. Once, thank you ,my Godot family!