Weld Tool to the Hand

How can I weld this tool to the hand :
https://gyazo.com/42c90074e0256e066e2722315183a162

I searched for it but can’t find any solution no matter what, the axe stays there.

I know there is an inbuilt function of equipping the tool but with that hand sticks out so it is no help:
https://gyazo.com/6f3fdf4dbca856f1b31ed5d4d03b56e8

6 Likes

What’s wrong with the Tool object doing the welding for you when equipping? If you do not like the hand-out, you can override it by playing an animation. Just make a simple animation for holding the tool and play it when the tool is equipped. It’s your easiest option.

2 Likes

To weld the tool, you should consider the length of the limb your attaching it to. With this code, I’m assuming your using custom avatar scaling so the following script should work for you.

local part = -- Handle that you'd be holding
local Character = -- Character
local weld = Instance.new("Weld",part)
weld.Part0 = part --Attach to the handle
weld.Part1 = character["RightHand"] --Attach to the right hand.
weld.C0 = CFrame.new(0, 0, 0) + Vector3.new(0,character["RightHand"].Size.Y/2,0)

This should allow you to weld to the an R15 hand, however this script doesn’t respect the tool handle’s orientation, so try to make sure you play with the handles rotation against the tool to make it upright.

You’ll need to weld it to the RightHand each time you equip it.

If you have anymore questions, lemme know :smiley:

34 Likes

Final Script:
https://gyazo.com/4fb885055e3f00be280e727afd76f3ac

Its Working :slight_smile:

Thanks

2 Likes

Tools automatically weld their handles to the player’s arm. Not sure what the issue here is.

Searched for what? Are you trying to make toolless tools or what? In both examples, you’re using a Tool instance yet state that it’s not welding to the hand. I’m confused.

Scripting Support is also not a location to ask for code. What have you tried yourself thus far in attempting to solve this?

I am using custom animations and I know tools automatically weld their handles to the player’s arm

The hand being stick out was ruining the animations that’s why
I tried using weld constraint and Moon Animation Plugin and I could not figure it out because the tool was not being positioned to my hand in the end I asked for help and I was going through alot of forum posts instead of any advantage I got confused thats why I asked for help
In return I got a simple fixed.

2 Likes

And now I know how to weld without any advance scripting.

I see, so you wish to use Tool instances while using a pseudo-handle to void the animation? Thanks for informing me, I suppose.

As a cautionary note, you should not be putting this code in a LocalScript. The only one who will see the tool properly held is the client. Contain this logic in a server script so that all clients can see that someone is actively holding a tool.

3 Likes

Thanks for the information :slight_smile:

This isn’t really connected to the problem but I have a doubt about this line, would writing the line below be the same?

weld.C0 = CFrame.new(0,character["RightHand"].Size.Y/2,0)

I know that CFrame + Vector3 translates the CFrame but I’m not sure if the second line (the one I wrote) would function the same.

With this I can position the axe

That doesn’t quite answer my doubt, my question is if using:

weld.C0 = CFrame.new(0, 0, 0) + Vector3.new(0,character[“RightHand”].Size.Y/2,0)

is the same as using:

weld.C0 = CFrame.new(0,character["RightHand"].Size.Y/2,0)

I’m not sure as I believe that the C0 and C1 of a weld store relative offsets, allowing the usage of the second line of code as well.

For programming etiquette, you can probably attempt doing the bottom. However it’s mostly for the purpose of understanding the code. There wouldn’t be any difference in performance in my eyes and it’d make no difference in what the outcome would be.

1 Like

Thanks for clarifying :smile:

I know this may have been said before, but please do not use Scripting Support for asking for code. Your question wasn’t clear enough. Be more careful next time.

I already answered it above please read all replies before criticizing.

In his defence, I think that he was asking a question on how he would weld it. While the wiki would have been a great resource to reference, he said what he was attempting to achieve, he explained the issue, which was he wanted to know how to weld, and he mentioned that he could use the tool which acts as a solution.

Personally, I think the thing people are concerned with when asking for code is that they ask people to complete their task for them without learning a single thing , but this was only 5 lines and I did this within my Study period, and those 5 lines can be adapted anywhere.

Anyway if the person wishes for some additional help, he should check the forum link.

1 Like