Tool Motor 6D Issue with grip

So a while ago I watched a tutorial on how to animate with motor6d grips, this required a script to take a motor 6d weld and a normal weld to weld onto the right arm then remove this normal weld and place a motor 6d.

this script seem to be depricated and struggles but i have no clue how to fix it.

Issues that are shown

  • The tool goes to normal tool grip position and comepletely ignores the weld
  • tool doesnt weld at all and falls through the map

examples:

One with the problem
image

How its suppose to work
image

Heres the script if there anything to edit that may fix this (this is a server script)

local motorName = "Handle" 

local player
local character
local humanoid
local rightHand

script.Parent.Equipped:Connect(function()
	if player == nil then
		player = game.Players:GetPlayerFromCharacter(script.Parent.Parent)
	end
	if character == nil or character.Parent == nil then
		character = script.Parent.Parent
		humanoid = character.Humanoid
		rightHand = character:WaitForChild("Right Arm")
	end
	local getWeld = rightHand:WaitForChild("RightGrip")      
	local motor = Instance.new("Motor6D")
	motor.Name = motorName
	motor.Part0 = getWeld.Part0
	motor.Part1 = getWeld.Part1
	--motor.C0 = getWeld.C0
	--motor.C1 = getWeld.C1
	
	wait(motor)
	motor.Parent = rightHand
	getWeld:Destroy()

	local function onUnequipped()
		if motor then
			motor:Destroy()
			getWeld:Destroy()
		end
	end
	script.Parent.Unequipped:Connect(onUnequipped)

	local function onParentChanged()
		if not script.Parent:IsDescendantOf(game) then
			onUnequipped()
		end
	end
	script.Parent.AncestryChanged:Connect(onParentChanged)
end)

This has been a problem for a while so any feedback or steps would be really appreciated, Thanks!

2 Likes