This error has a simple fix really. :GetPlayerFromCharacter() can only be used if you have the players character, however, tools initially spawn in the player itself. Only when they are equipped are they then moved to the character. You’re code is working before you have the chance to even equip it. To fix this merely replace:
player = game.Players:GetPlayerFromCharacter(tool.Parent)
I feel really dumb now, I complete forgot about the :IsA(“Backpack”)!!!, sorry about not being more detailed, Im not the best at explaining : '(
the tool uses a motor6d as a grip, im trying to make it grip onto the right arm when it realizes its in a players backpack, so when a player equips the tool, its already welded onto the arm.