Need help with tool

so i have trouble with setting the tool to the player’s right hand properly and when i equip the tool it’s not even near the player, it stays at the place i left it. idk why i used a script

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

local function attachToRightHand()
	local character = tool.Parent
	if character:IsA("Model") and character:FindFirstChild("Humanoid") then
		local rightHand = character:FindFirstChild("RightHand") or character:FindFirstChild("Right Arm")
		if rightHand then
			handle.CFrame = rightHand.CFrame

			-- Optionally, create a Weld to keep it attached
			local weld = Instance.new("WeldConstraint")
			weld.Part0 = rightHand
			weld.Part1 = handle
			weld.Parent = handle
		end
	end
end

tool.Equipped:Connect(attachToRightHand)

It’s a familiar problem, but I don’t remember exactly how I solved it, but the problem is definitely not in the script. To solve this problem you need to create a Weld to bind the tool model to Handle

This topic was automatically closed 14 days after the last reply. New replies are no longer allowed.