Ad
Still have questions? Join our Discord server and get real time help.
Log in to vote
0

Why won't this CFrame's work?

Asked by 5 years ago

So here is the script:

local tool = script.Parent


local chr = tool.Parent.Parent.Character
local handle = tool:FindFirstChild("Handle")


tool.Equipped:connect(function()
    if tool and chr then
        local la = chr:FindFirstChild("Left Arm")
        torso = chr:FindFirstChild("Torso")
        RS = torso["Right Shoulder"]
        LS = torso["Left Shoulder"]
        if RS and LS and handle then
            RS.C0 = RS.C0 * CFrame.Angles(0, 0.5, 0)
            LS.C0 = LS.C0 * CFrame.Angles(0.5, 0, 3)
            local function weld(a, b)
                local weld = Instance.new("ManualWeld")
                weld.Part0 = a
                weld.Part1 = b
                weld.C0 = CFrame.new()
                weld.C1 = b.CFrame:inverse() * a.CFrame
                weld.Parent = a
            end
            weld(handle, la)
        end
    end
end)

tool.Unequipped:connect(function()
    RS.C0 = RS.C0 * CFrame.Angles(0, -0.5, 0)
    LS.C0 = LS.C0 * CFrame.Angles(-0.5, 0, -3)
end)

So the RS works fine but the LS does not wan't to be placed where it is supposed to be. Anyone know why? Thanks!

Answer this question