Attach an object ( what am I doing wrong ? )

Nice. It’s like should be. You not need to set sword variable to attach, but this (variable) will be handy for future use and here is all correct.