Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

How To Remove The "Left Arm" Weld?

Can somebody help me? I'm trying to get rid of the line were it say "Left Arm" but it didn't work for me. When I tested it my left arm fall off instead.... I want only the "Right Arm" to work, not both arms. I've tried many times and the arm keep falling off, what did I do wrong? Can you guys help me?

Here's an image to see what I'm talking about:

https://gyazo.com/4e24b619184f5c3c08fd9b819a69277b

This is a regular script that goes into the tool:

Name of this script: (WeldArm)

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.5, 0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, 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.5, 0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), math.rad(0), 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)

Many thanks my friends!

1 answer

✓ Accepted answer

I think that you can just remove the tables that were meant to store the left arm and the left shoulder. Also, you should remove that "weld2" which referenced the left arm.

After that, your script should only affect the right arm and right shoulder.

Tool = script.Parent;
local arm = nil
local torso = nil
local weld1

function Equip(mouse)
	wait(0.01)
	arm =  Tool.Parent:FindFirstChild("Right Arm")
	torso = Tool.Parent:FindFirstChild("Torso")
	if arm ~= nil and torso ~= nil then
		local shd = torso:FindFirstChild("Right Shoulder")
		if shd ~= nil then
		local yes = true
			if yes then
				yes = false
				shd.Part1 = nil
				weld1 = Instance.new("Weld")
				weld1.Part0 = torso
				weld1.Parent = torso
				weld1.Part1 = arm
				weld1.C1 = CFrame.new(-1.5, 0.5, 0.5) * CFrame.fromEulerAnglesXYZ(math.rad(-90), 0, math.rad(0))
			end
		else
			print("sh")
		end
	else
		print("arms")
	end
end

function Unequip(mouse)
	if arm ~= nil and torso ~= nil then
	local shd =  torso:FindFirstChild("Right Shoulder")
		if shd ~= nil then
		local yes = true
			if yes then
			yes = false
			shd.Part1 = arm
			weld1.Parent = nil
			end
		else
			print("sh")
		end
	else
		print("arms")
	end
end
Tool.Equipped:connect(Equip)
Tool.Unequipped:connect(Unequip)

2 comments

0

If the script isn't working, please comment that it is not so that I can inspect why.

0

Thanks! It works just fine the way it is. Thank you =)

This discussion is preserved as it was. New answers, comments, and votes are closed.