Tool not properly Welding to hand for Tool Equipping Emulation Script

I have this equiptool system to replace the backpack for my custom inventory system
because I personally just generally dislike how it works and it’s functionality, I struggled a lot trying to make it not put stuff in the backpack cause the backpack is hidden, but couldn’t get a system going to make it make sure there wasnt a item in the player being held and remove its leftover instance in the backpack, but couldn’t do it

so I tried to make a manual replacement system, but for some reason
I when I try to weld the tool to the hand it just makes it glitch out like this:


(SORRY FOR THE BAD IMAGE, the tool was only showing when using an anim cause it is like connected to it underground or smth)

for some reason the handle is actually in the hand, although I do thin this is reversed. and not how its supposed to be held.

-- Manual tool system to replace Backpack

local Players = game:GetService("Players")
local RunService = game:GetService("RunService")
local UserInputService = game:GetService("UserInputService")

local ToolHandler = {}
local equippedTools = {}

-- Utility: weld two parts
local function weld(part0, part1) -- part 0 is handle part 1 is hand
	local weld = Instance.new("WeldConstraint")
	weld.Part0 = part0
	weld.Part1 = part1
	weld.Parent = part0
	return weld
end

-- Unequip current tool
function ToolHandler.Unequip(player)
	local char = player.Character
	if not char then return end

	local current = equippedTools[player]
	if current then
		current.Model:Destroy()
		equippedTools[player] = nil
	end
end

-- Activate tool manually
function ToolHandler.Activate(player)
	local tool = equippedTools[player]
	if tool and not tool.Active then
		tool.Active = true
		-- Custom attack/activation logic
		print(player.Name .. " activated " .. tool.Model.Name)
		task.delay(0.5, function()
			if equippedTools[player] then
				equippedTools[player].Active = false
			end
		end)
	end
end

-- Equip a tool model
function ToolHandler.Equip(player, toolModel)
	local char = player.Character
	if not char then return end

	ToolHandler.Unequip(player)

	local toolClone : Tool = toolModel:Clone()
	toolClone.Parent = char

	local rightHand = char:FindFirstChild("RightHand") or char:FindFirstChild("Right Arm")
	local rightHandGrip : Attachment = rightHand:FindFirstChild("RightGripAttachment")

	for i,v in pairs(toolClone:GetDescendants()) do
		if v:IsA("MeshPart") or v:IsA("Part") then
			weld(v, rightHand)
		end
	end

	equippedTools[player] = {
		Model = toolClone,
		Active = false,
	}

	if player == Players.LocalPlayer then
		if player:GetMouse() then
			local mouse = player:GetMouse()
			mouse.Button1Down:Connect(function()
				ToolHandler.Activate(player)
			end)
		end
		
		UserInputService.TouchStarted:Connect(function(input, gameProcessed)
			if gameProcessed then return end
			ToolHandler.Activate(player)
		end)
	end
end

return ToolHandler

the tools hierarchy looks like this, and also ingame it holds together on play, it also works fine when equipped regularly as a tool

online I saw people reccomend their own tool equip fake scripts but importing those didn’t fix it either, so im just confused rn, why is this even happening??

1 Like

You need to weld them prolly in the studio, as in not when the game runs, this always happens to me if the handle and stuff aren’t welded

1 Like

As @EzraPalo said, weld all your tool Parts to the Handle manually. It helps because right now you have QPerfection weld joining them together, and then you weld each Part to the right hand.
Save yourself a LOT of hassle by manually welding the tool Parts together, then when you equip it just weld the Handle to the RightHand.

Make all tool Parts Massless Propertly true.

You are welding the part to the hand using Part0 and Part1, but you aren’t setting the weld C0 or C1 property. These are the Properties that tell the weld how to offset and rotate the weld so the parts aren’t centered on each other. Set the Position and Orientation properties on either the C0 or the C1 Offset so it fits the hand properly.

2 Likes

The Solution IS welding them all together in workspace,

but for people googling this for help
and personally me, do you or anyone else know why this happens?

I would honestly LOVE to be able to use a easy welder, without having to go to the extra work.

1 Like

I use rig edit plugin, it works rly well for tools as well.

1 Like

Use an easy welder so it welds itself in test mode, but now save the model while in test mode.
All the welds will be there in the saved model, and you can delete the welding script.