i need to get the left and right shoulder (motor6d) from my table bptable. i want to return both the left and right shoulder and then print the m6d name if that makes sense. the problem is is that it’s printing only “LeftLowerArm” and idk what im doing wrong. i appreciate any help ty!!
local bpTable = {
Head = c:WaitForChild("Head"),
RightHand = c:WaitForChild("RightHand"),
LeftHand = c:WaitForChild("LeftHand"),
LowerTorso = c:WaitForChild("LowerTorso"),
RightLowerArm = c:WaitForChild("RightLowerArm"),
LeftUpperArm = c:WaitForChild("LeftUpperArm"),
LeftLowerArm = c:WaitForChild("LeftLowerArm"),
RightUpperArm = c:WaitForChild("RightUpperArm"),
UpperTorso = c:WaitForChild("UpperTorso"),
RightShoulder = c:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder");
LeftShoulder = c:WaitForChild("LeftUpperArm"):WaitForChild("LeftShoulder");
RightElbow = c:WaitForChild("RightLowerArm"):WaitForChild("RightElbow");
LeftElbow = c:WaitForChild("LeftLowerArm"):WaitForChild("LeftElbow")
}
local function getShoulders()
repeat wait()
until workspace:FindFirstChild(c.Name)
if c then
print("found ".. c.Name)
end
for _, m6d in pairs(bpTable) do
if m6d == bpTable.LeftShoulder or bpTable.RightShoulder then
return m6d
end
end
end
print(getShoulders())
thats exactly what i wanted mate, thanks a million man have a great day and thank u for helping me
solution:
local bpTable = {
Head = c:WaitForChild("Head"),
RightHand = c:WaitForChild("RightHand"),
LeftHand = c:WaitForChild("LeftHand"),
LowerTorso = c:WaitForChild("LowerTorso"),
RightLowerArm = c:WaitForChild("RightLowerArm"),
LeftUpperArm = c:WaitForChild("LeftUpperArm"),
LeftLowerArm = c:WaitForChild("LeftLowerArm"),
RightUpperArm = c:WaitForChild("RightUpperArm"),
UpperTorso = c:WaitForChild("UpperTorso"),
RightShoulder = c:WaitForChild("RightUpperArm"):WaitForChild("RightShoulder");
LeftShoulder = c:WaitForChild("LeftUpperArm"):WaitForChild("LeftShoulder");
RightElbow = c:WaitForChild("RightLowerArm"):WaitForChild("RightElbow");
LeftElbow = c:WaitForChild("LeftLowerArm"):WaitForChild("LeftElbow")
}
local function getShoulders()
repeat wait()
until workspace:FindFirstChild(c.Name)
if c then
print("found ".. c.Name)
end
for i, v in pairs(bpTable) do
if i == "LeftShoulder" or i == "RightShoulder" then
print(i.." = "..v.Name)
return v
end
end
end
getShoulders()