(I’m just gonna keep this one short because I’m pretty sure that there’s an easy fix for this, but I can’t really figure it out.)
First, I’m temporary using an modified verison of xSIXx’s “Tool Grip to Motor6D” (yes I know, he said don’t change anything inside the script, but I only changed it to correctly position the tool.), if you want to see the code, check at the bottom of this post.
The first problem is whenever the player equips the Tool, a script inside of it deletes the RightGrip Weld and replaces it with a Motor6D version of it, BUT before it replaces it, it use CFrame to position it so the Player can hold the tool correctly. However when equipping the tool for the first time, CFrame doesn’t really works, but when the second time or beyond, it works for whatever reason. Not entirety sure what is causing this…
The second problem is whenever the player equips the Tool, it runs the aforementioned code, but it slightly nudges the player forward a bit, and whenever the Player equips the tool mid-air, it “repositions” them, making this an hassle when they’re trying to escape another player. I definitely know this is something with the CFrame code, let me know if there’s any alternative.
-- xSIXx, Create an animatable joint when tool is equipped.
local motorName = "RightGrip" -- Change this to the target Motor6D name you want in the Right Arm/RightHand.
-- DO NOT CHANGE ANYTHING BELOW. I'm not going to help you solve issues with this script if you have changed any of the code below. --
------------------------------------------------------------------------
-- variables
local player
local character
local humanoid
local isR15
local rightHand
------------------------------------------------------------------------
-- stuff
do
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
isR15 = humanoid.RigType == Enum.HumanoidRigType.R15
rightHand = isR15 and character:WaitForChild("RightHand") or character:WaitForChild("Right Arm")
end
local getWeld = rightHand:WaitForChild("RightGrip")
getWeld:Destroy()
script.Parent.Handle.CFrame = rightHand.CFrame:ToWorldSpace(CFrame.new(0,-0.15,0))
local motor = Instance.new("Motor6D")
motor.Name = motorName
motor.Part0 = rightHand
motor.Part1 = script.Parent.Handle
--motor.C0 = getWeld.C0
--motor.C1 = getWeld.C1
motor.Parent = rightHand
end)
end