When the players WalkSpeed is 40 then I want the arms to weld, which it does just fine, and when the players walkspeed is 16 or 0 I want them to also weld, which also works fine, but sometimes it will glitch and put my arms in the second position randomly, or put them in the second position if I jump, and essentially break the whole thing and when I walk they will not weld anymore.
plyr = game:GetService("Players").LocalPlayer
char = plyr.Character
head = char:findFirstChild("Head")
torso = char:findFirstChild("Torso")
ra = char:findFirstChild("Right Arm")
la = char:findFirstChild("Left Arm")
rl = char:findFirstChild("Right Leg")
ll = char:findFirstChild("Left Leg")
neck = torso:findFirstChild("Neck")
rs = torso:findFirstChild("Right Shoulder")
ls = torso:findFirstChild("Left Shoulder")
rh = torso:findFirstChild("Right Hip")
lh = torso:findFirstChild("Left Hip")
hum = char:findFirstChild("Humanoid")
cam = game.Workspace.CurrentCamera
m = plyr:GetMouse()
RAB = Instance.new("Part")
RAB.formFactor = "Custom"
RAB.Size = Vector3.new(0.2, 0.2, 0.2)
RAB.Transparency = 1
RAB.Parent = char
RAB:BreakJoints()
RABW = Instance.new("Weld",RAB)
RABW.Part0 = char.Torso
RABW.Part1 = RAB
RABW.C1 = CFrame.new(-1.5, -0.5, 0)
LAB = Instance.new("Part")
LAB.formFactor = "Custom"
LAB.Size = Vector3.new(0.2, 0.2, 0.2)
LAB.Transparency = 1
LAB.Parent = char
LAB:BreakJoints()
LABW = Instance.new("Weld",LAB)
LABW.Part0 = char.Torso
LABW.Part1 = LAB
LABW.C1 = CFrame.new(1.5, -0.5, 0)
RAW = Instance.new("Weld",RAB)
RAW.Part0 = RAB
RAW.Part1 = nil
RAW.C1 = CFrame.new(0, 0.5, 0)
LAW = Instance.new("Weld",LAB)
LAW.Part0 = LAB
LAW.Part1 = nil
LAW.C1 = CFrame.new(0, 0.5, 0)
hum.WalkSpeed = 40
hum.Running:connect(function(sp)
if sp == 40 then
LAW.Part1 = la
RAW.Part1 = ra
LAW.C0 = CFrame.Angles(math.rad(-110),0,0)
RAW.C0 = CFrame.Angles(math.rad(-110),0,0)
elseif sp == 0 or sp == 16 then
RAW.C0 = CFrame.Angles(math.rad(0),0,0)
LAW.C0 = CFrame.Angles(math.rad(0),0,0)
end
end)

2 comments
Any output?
Nope.