To fix roblox tool grip weld I use my code example. And you can use it too

This code is used to weld the tool the same way roblox default tools weld to the arm of a character
Now you can put this script in a local script to make it weld to the player without lag

local tool=script.Parent
local handle=tool:FindFirstChild("Handle")

--these here are to reduce indexxing and this is a super-micro-optimsation
local instancenew=Instance.new
local mathrad=math.rad
local cframeangles=CFrame.Angles
local cframenew=CFrame.new
local mathhuge=math.huge
--
local function GetClosestPart(m: Instance,from: Vector3): BasePart
	local dist=mathhuge
	local t=nil
	for i, v in m:GetChildren() do
		if v:IsA("BasePart") then
			local d=(v.Position-from).Magnitude
			if d<dist then
				dist=d
				t=v
			end
		end
	end
	return t
end

tool.Equipped:Connect(function()
	local ClosestPart=nil
	
	if not tool:FindFirstChild("Handle") then
		handle=GetClosestPart(tool,tool:GetPivot().Position)
	end
	
	ClosestPart=GetClosestPart(tool.Parent,handle.Position)
	
	
	for i, v in ClosestPart:GetChildren() do --no need for pairs() because this is luau
		local name=v.Name
		if name=="Grip" or name=="RightGrip" then
			v:Destroy()
		end
	end
	
	local Weld=instancenew("Weld",ClosestPart)
	Weld.Part0=ClosestPart
	Weld.Part1=handle
	Weld.C0=cframenew(0,-1,0)*cframeangles(mathrad(-90),0,0)
	Weld.C1=tool.Grip
	Weld.Name="Grip"
end)

This also fixes some bugs where the tool wont even weld at all

This does exactly what roblox tools do when you equip them
It makes the same weld as the “RightGrip” made when equipping a tool but it is just a peice of code that you can copy/paste

The other cool thing about this code is that you can make a tool weld onto the players hand with other parts other than the “Handle”

It takes the default C0 of a rightgrip weld and add the offset set by the tool (tool.grip) into C1

I havent tested it on r15

I uh have some tips :sweat_smile:

  1. Use
    ```lua
    code
    ```
    to make code blocks, instead of //.
  2. Write out your code in Studio (or any code editor) first and then paste it into your post so you can get proper indentation (Why havent they made pressing tab indent yet???)
  3. If all you’re going to post is a piece of code, the least you can do is explain how and why it works, and maybe even a little guide as to how to use it :sweat_smile:

Just a little constructive criticism for what I assume is your first resource :slight_smile:

Thank you
I have simply forgot forgot forgot forgot forgot