Another way of doing this is to use one code on multiple weapons, like this:
extends Node
export var identifier = "Unknown
export var damage = 0
export var damageModifier = 0
export var tier = -1
Then add that script to each weapon, and you can change the exported variables for each one.
Then, on another node, add a function like this to select each weapon if you have it.
func select_weapon(selected_weapon):
hide_all_weapons() #All this is is a code I use to make all the weapons hide before being chosen. It's mostly get_node(whatever).visible = false for every weapon.
if selected_weapon == name:
selected_weapon.show()
Selected weapon, in my case, was actually an integer which each weapon had. Then, for each child of the parent node that holds the weapons, if the chosen weapon has the same number as one of the weapons, use that child's stats- but you can also use a weapon's name.