So I made a tool where the player can click and it puts their avatar’s hands together, upon testing the script, only one of the avatar’s hands raises and the other doesn’t move. Anyone know why this is?
Weld Script:
local BrickTable = {}
function RecursiveGeneric(Parent, Func, ClassLimit)
for _, Child in pairs(Parent:GetChildren()) do
if not ClassLimit or Child:IsA(ClassLimit) then
Func(Child)
end
RecursiveGeneric(Child, Func, ClassLimit)
end
end
RecursiveGeneric(
script.Parent,
function(Brick) table.insert(BrickTable, Brick) end,
"BasePart"
)
local Base = BrickTable[1]
table.remove(BrickTable, 1)
for _, Part in pairs(BrickTable) do
local Weld = Instance.new("Weld")
Weld.Part0 = Base
Weld.Part1 = Part
Weld.C1 = Part.CFrame:inverse() * Base.CFrame
Weld.Parent = Base
Part.Anchored = false
end
Base.Anchored = false
Weld Arm:
Tool = script.Parent;
local arms = nil
local torso = nil
local welds = {}
function Equip(mouse)
wait(0.01)
arms = {Tool.Parent:FindFirstChild("Left Arm"), Tool.Parent:FindFirstChild("Right Arm")}
torso = Tool.Parent:FindFirstChild("Torso")
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = nil
sh[2].Part1 = nil
local weld1 = Instance.new("Weld")
weld1.Part0 = torso
weld1.Parent = torso
weld1.Part1 = arms[1]
weld1.C1 = CFrame.new(1, 0.25, 0.33) * CFrame.fromEulerAnglesXYZ(math.rad(-110), 0.6, math.rad(0))
welds[1] = weld1
local weld2 = Instance.new("Weld")
weld2.Part0 = torso
weld2.Parent = torso
weld2.Part1 = arms[2]
weld2.C1 = CFrame.new(-1, 0.25, 0.33) * CFrame.fromEulerAnglesXYZ(math.rad(-110), -0.6, math.rad(0))
welds[2] = weld2
end
else
print("sh")
end
else
print("arms")
end
end
function Unequip(mouse)
if arms ~= nil and torso ~= nil then
local sh = {torso:FindFirstChild("Left Shoulder"), torso:FindFirstChild("Right Shoulder")}
if sh ~= nil then
local yes = true
if yes then
yes = false
sh[1].Part1 = arms[1]
sh[2].Part1 = arms[2]
welds[1].Parent = nil
welds[2].Parent = nil
end
else
print("sh")
end
else
print("arms")
end
end
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)