Help with the change of weapons

Godot Version

4.2

Question

I did that on the dynamic weapon sway player for weapons like in this video https://www.youtube.com/watch?v=JrQicb3fwiA&t=1s, 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.