Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
0

For some reason the running event is glitching?

Asked by 10 years ago

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)
0
Any output? systematicaddict 295 — 10y
0
Nope. RootDirectory 10 — 10y

1 answer

Log in to vote
0
Answered by
lomo0987 250 Moderation Voter
10 years ago
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 ~= 40 then
RAW.C0 = CFrame.Angles(math.rad(0),0,0)
LAW.C0 = CFrame.Angles(math.rad(0),0,0)
end
end)

That should fix it. I just changed line 61.

Ad

Answer this question