Help with the change of weapons

Godot Version



I did that on the dynamic weapon sway player for weapons like in this video, and the weapon was made through a resource base where data about a specific weapon is stored.
The node type cannot be set in the resource database.
How to make it so that when changing weapons on his script, the node with the model weapon on the player also changes .
I’m sorry if it’s not clear at all, I’m a beginner and still have a problem with the language, ask for details.