"How to change a Tool's Equipped Arm"

Well… i have a Shield Tool in my game, and i want the player to equip it from the left Arm.

thats just it, i dont have anything left to say. can someone give me a direction?

I think you should disable your “RequiresHandle” property in your tool first(not sure if this is necessary) then you should make a dummy, then make a motor6d on dummy’s left arm and set Part0 to left arm, set Part1 to handle (you need every parts of tool welded to handle). and adjust C0 CFrame to the cframe you want.

And If you finished adjusting CFrame you want, now you should make a script inside a tool that it makes motor6D when equipped, you can do it as server or local script but lets do server.

-- Tool's Server Script --
local tool = script.Parent
local Handle = tool.Handle

Tool.Equipped:Connect(function()
    local character = tool.Parent
    local left_arm = character:WaitForChild('Left Arm') -- character should be R6
    if left_arm then
        if left_arm:FindFirstChild('ShieldMotor6D') then return end -- checks if there already is motor6d
        local Motor6D = Instance.new('Motor6D', left_arm)
        Motor6D.Name = "ShieldMotor6D"
        Motor6D.Part0 = left_arm
        Motor6D.Part1 = Handle
        Motor6D.C0 = --the cframe C0 of motor6d you made on the dummy's left arm
    end
end)

And I think that’s end of Equipping script, also you can get the C0 of dummy’s motor6D by this script (you can do this on command Bar)

local Dummy = workspace.Dummy -- the dummy you had adjusted Motor6D on
local LeftArm = Dummy:WaitForChild('Left Arm') -- need to be R6 dummy
local Motor6D = LeftArm.Motor6D -- the motor6D you edited/adjusted for the tool
if Motor6D then
print(Motor6D.C0)
end

And there will be the CFrame value on the output, just copy all the CFrame value then do this.

--Tool's ServerScript line 13--
Motor6D.C0 = CFrame.new(A) --value A is the cframe value you copied on clipboard

Hope that helped.

1 Like

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