Making a melee

Right, so Ive made and exported my Minecraft sword to Garrys Mod, and I need some help turning it into a working melee

What i tried was renaming the original model to w_crowbar and a copy to v_crowbar (Of the sword)

Doing so did this

Any help is welcome

Luckily for you, I’ve gone through this whole fiasco once before (Also with a minecraft sword, oddly), and the fix isn’t as hard as you’d imagine.

What’s happening here is that the model isn’t rigged to any bones on the player, so as a result it’s not being merged to any bones, and by proxy, the hand. What you’ll need to do is to decompile the w_crowbar model (Or the w_stunbaton model) using mdldecompiler, import the Crowbar_Reference.SMD into your modelling program, then simply place and align the sword over the crowbar in the program. Make the handles in the same place. Alternatively make the players hold the sword upside down. Mix things up a bit.

After that, it’s just a matter of skinning it to the same bones that the crowbar model was (There will only be about 2, I don’t think the crowbar has muzzle flash or shell ejection). The one called ValveBiped.Bip01_R_Hand is the important one. Then delete the crowbar model.
Then simply export, compile and hopefully everything should work now that there’s a nice shiny new bone rigged to your world model with the right angles.

Oh and make sure you change the QC so it doesn’t overwrite your v_ model. Compile it from day 1 as a w_model, it’ll save a lot of hassle.