Why doesn't my weld script work?

Hey everyone,

Got a quick question about a script I’m making. I’ve made a tool, but I don’t want the normal holding animation. I’ve checked of requires handle and made a script to weld a part of the tool onto the right hand of the character. Here is the script, run via LocalScript:

local Weld = script.Parent:WaitForChild("WeldConstraint")

local Player = game.Players.LocalPlayer



local Human = game.Workspace:WaitForChild(Player.Name)

local Arm = Human:WaitForChild("RightHand")

local Tool = script.Parent

Weld.Part0 = Arm

Weld.Enabled = false
function weldHand()
	
	Weld.Enabled = true
	
end

Tool.Activated:Connect(weldHand)

It doesn’t work, the tools never comes to the hand. No errors are inside the output. Here is the setup:

This is my first time using WeldConstraints, so I might be using them wrong.

Thanks! :slightly_smiling_face:

Have you set part1? I don’t see anything wrong in the script.

Yes, I did set part 1. That’s why I find the fact that it doesn’t work strange.

Are you able to equip the tool?
I dont see a use for this if you can just equip the tool
Also if the Tool is in StarterPack its technically not in the game until you equip it because it gets cloned to the players backpack
So for this to work the player should have the tool equipped
BUT for Activated to work the player must have the tool equipped

Yes, you can equip it, and the tool appears, however it isn’t welded to the hand.

I think you should weld the tool when you equip the tool, not activate it.

Oh my god! I totally overlooked that! I meant to do it when it equips! Let me try again!

What about the Weld.Part0…? That’s like the most imortant part.

That part is already there. Thanks for trying however!

Ok so hopefully @DetailedModuler solves your problem but i still dont understand why you would need to use this if you can just equip it but you do you message if anything goes wrong

Also what about Part1? idk if im not seeing it but seems like you need that

How about the Part1?
I misstyped, sorry.

I think you need to do:

tool.Equipped:connect(function()
   --set Weld.Part0 = tool.Parent:WaitForChild("RightHand")
end)

It’s equipped from the weld constraint property itself.

@DetailedModuler, that kind of fixed it, but now it’s not right at the hand. (Video uploading, hang on).

Edit: Here is the video:

1 Like

So its not being taken out the players BackPack?

You mean the position isn’t right? Change the tool Cframe to hand’s CFrame

That is what I am doing currently. I can upload the model really quickly.

testtool.rbxm (5.6 KB)

Where the hand should be? That grey part?

Yes. That’s the “handle”. I can’t use handles as I don’t want the default animation.

How about the orientation of the tool?
Maybe you could just set grip’s position to hand’s position before it welds.

It’s welded to the grey part, which gets welded to the hand.