How to weld things in Roblox Studio 2022

Help and Feedback Scripting Support

I’m looking for a way to create a sword that is not a tool, and is always active. Think a weapon that you can’t unequip by pressing the number buttons. Instead, it’s always equipped and the player can click at any time to attack.

The problem I’ve run into is that I don’t know how to weld the sword to the playermodel. I want to be able to animate the sword with Moon Animator, so I want it to physically be part of the player’s model.

I followed the guide under this post about accessories but that didn’t work for me. I would really prefer to not make it a tool, as the weapon is going to have multiple attacks that can be used by pressing keys.

What should I do here? Should I just make the starter player be a standard rig with a sword welded to it? Or is there some kind of script that can attach the sword to the arm? Sorry if this is vague. I can send pictures of what I’m trying to achieve when I get home.

1 Like

Its a bit complicated explaining it in text, I suggest you to learn welding through videos.

How to weld things in Roblox Studio 2022

How to weld things in Roblox Studio 2022

How to weld things in Roblox Studio 2022

1 Like

All you have to do is go into the moon animator plugin and click easy weld after that then click the arm you want the sword to be on and then the sword itself, then click “Join In Place”, this keeps whatever your welding to keep its CFrame

//devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/4X/a/3/e/a3eba4addf7732581f6046f619651a4c9e90f65a.mp4

yes thank you. but how would i weld it to the player character’s model? do i make that rig with the weld the starter character?

Oh you just select the part you want to weld it too like say you want to weld the part to your left arm just weld it to the left arm, then make sure to put the part inside of the players character

Ok, so I feel I should clarify some things. I want to make a custom tool system, similar to games like DemonFall, where you press R or something to draw your sword without there being a toolbar at the bottom for the sword. I’m trying to figure out how I could do this, but it’s so hard to find information on this. As I said before, I used this forum to try and get help, but the last time it was posted on was in April of 2021. Even if it does still work, it’s not working for me for some reason. The object I’m trying to weld to the player’s hand doesn’t even appear when I put the accessory into ServerStorage. This is frustrating me so much because in order to make literally any progress on my game I need this mechanic to work. Does anyone have an answer for this? Reviewing what welding is and what it does doesn’t exactly help me figure out how to weld the tool to the player’s hand, and I don’t know how I would switch the weapons when needed, like spawning players with other weapons aside from the one I’m currently making.

Help and Feedback Scripting Support

I’m trying to make a tool on hip / back script with multiple parts while this only works with one part that’s named handle. I’ve got it to work when unequipping but when I equip the tool again It breaks. I’m pretty sure the issue with the code is in function onEquipped

handle = nil function onUnequipped() if script.Parent.Parent == workspace or script.Parent.Parent.className ~= "Backpack" then return end local char = script.Parent.Parent.Parent.Character if char ~= nil then local torso = char:findFirstChild("Torso") local tool = char:findFirstChild(script.Parent.Name) if torso ~= nil and tool == nil then local model = Instance.new("Model") model.Name = script.Parent.Name model.Parent = char handle = script.Parent for i, v in pairs(handle:GetChildren()) do if v:IsA("Part") then v.CanCollide = false v.Name = script.Parent.Name v.Parent = model local weld = Instance.new("Weld") weld.Name = "BackWeld" weld.Part0 = torso weld.Part1 = v weld.C0 = CFrame.new(0,0,0.6) weld.C0 = weld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(90),math.rad(330),0) weld.Parent = v end end end end end script.Parent.Unequipped:connect(onUnequipped) function onEquipped() if handle ~= nil then handle.Parent:remove() end end script.Parent.Equipped:connect(onEquipped)```

There’s two ways you could weld stuff.

1:
Create a WeldConstraint, set Part0 to the Handle and then Part1 to what you want to weld to said Handle and repeat that for each part that you want to weld. The part you are welding to the handle has to be unanchored.

2:
Use qPerfectionWeld from the toolbox which automatically welds everything together for you. Put the script into your model which has all the parts in it and done.

Are you using an R15 or R6 character? R15 doesn’t have a “Torso”.

Also why are you welding all the Parts individually to the players back? If you Weld all the Parts to the Handle in the weapon Model that you built you only have to use 1 Weld to attach the Handle to the player’s back.

function onEquipped() if handle ~= nil then handle.Parent:remove() end end

This destroys the tool. Also, this script is clearly quite old, I presume this is a free model you found.

Help and Feedback Scripting Support

Im trying to put a hammer to a charcacter but the hammer is in the middle of the right had and the animation is not working properly

Heres a video:

//devforum-uploads.s3.dualstack.us-east-2.amazonaws.com/uploads/original/4X/7/a/c/7ac6881322bfff8c4a9ed058bf067b867157e1a5.mp4

The part where the character looks up, the hammer should be in the air( Like hes throwing it). I animated the hammer to be in the air and do some spins.( roblox animation plugin)

At one point i fixed it but i changed something and it broke ( i have no idea what i changed or whats the cause)

I tried adding motor6d to the arm and make the PartC0 to the hammer, the hammer is in the hand but its in the middle and the hammer is not being animated. I tried using attachments but it didnt work( I added green circles to the chacacter hand and the hammer). I tried to put fake arm but its not being animated

Heres the script i use in game>ServerScriptService

local players = game:GetService("Players") local sword = game:GetService("ServerStorage")["hammer"] local function giveSword(character) local arm = character:WaitForChild("Right Arm", 1) if (arm ~= nil) then local s = sword:Clone() s.Parent = character local w = Instance.new("Motor6D") w.Part0 = arm w.Part1 = s w.Parent = arm end end local function connectPlayer(player) if (player.Character ~= nil) then -- if they already spawned giveSword(player.Character) end player.CharacterAdded:Connect(giveSword) end -- in the rare chance that players are in the game before the script runs for _, player in ipairs(players:GetPlayers()) do connectPlayer(player) end players.PlayerAdded:Connect(connectPlayer)

Im not asking for a whole script. Any help will be appreciated

2 Likes

There is a plugin to position the tool without any scripting so if you have 5 Robux to spare then I recommend you using this plugin: Tool Grip Editor - Roblox

Or if you want to just to change the position for that tool, change 1 to any number that you want it position.

1 Like

the hammer is not a gear, It is a part. I clone the hammer and parent it to the character

Ok, since it is a part, I don’t think there is anything you can do it position it without making another script using Vector3. But I could be wrong so let me figure it out or someone will know the problem.

1 Like

I am so sorry for wasting your time. I gave up and changed the animation. It looks like the animation messed up and the hammer flying is not there. i fixed it now. Sorry for taking your time!
(BTW i animated a custom idle with the hammer in it so that i dont need to position the hammer)

Aw dang, but that fine, at least you figured it out

How to weld things in Roblox Studio 2022

1 Like