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

How do I make the arm stay stiff with motor6d?

Asked by 5 years ago
Edited 5 years ago
    local Players = game:GetService("Players")
    local player = Players.LocalPlayer
    local motor = player.Character.Torso:WaitForChild("Left Shoulder")
    motor.C0 = motor.C0*CFrame.Angles(0,0,80)
    wait(1)
    motor.C0 = motor.C0*CFrame.Angles(0,0,-80)
    print("moved")

the script just moves the arm up then down but how do I make the arm not move (The Left arm is playing the roblox walk animation) around when walking?

0
Did you even script this? The script does exacly what it's said to do, it sets Motor6D to 80 and then -80 with angles. I would recommend you learn instead of getting code from other people, since not even you know what it does. User#27525 1 — 5y
0
what are you on about? he's clearly just asking how he can make the arm stay stiff, the animations are probably fighting his code lokkut 20 — 5y
0
Dude, if he didn't make the script he won't know what he's doing, which is a problem. User#27525 1 — 5y
0
Anyway, i'm posting how to make the arm stand still. User#27525 1 — 5y
View all comments (2 more)
0
I did make this very basic script I just wanted the arm to be stiff like the right arm when holding a tool instead the left arm plays the Roblox walking animation SWARMHOST77 12 — 5y
0
wasd Lyphios 77 — 4y

2 answers

Log in to vote
0
Answered by 5 years ago
Edited 5 years ago

Here's what's wrong:

local Players = game:GetService("Players") -- Get players service
local player = Players.LocalPlayer -- Get the current person that own the local script
local motor = player.Character.Torso:WaitForChild("Left Shoulder") -- Get the Left Shoulder Motor6D
motor.C0 = motor.C0*CFrame.Angles(0,0,80) -- Changes Motor6D angle to 80

Remove the part of the script below so it'll keep the angle at 80.

wait(1)                          -- After a second, it'll change motor6d angle to -80
motor.C0 = motor.C0*CFrame.Angles(0,0,-80)
print("moved")
0
Perhaps I didn't say describe my problem correctly, The script works fine it does what I want ( move the left arm up then back down) the problem is that when I walk the arm moves doing the normal roblox walk animation. I'm trying to get the left arm to be stiff like the right arm when holding a tool. SWARMHOST77 12 — 5y
Ad
Log in to vote
0
Answered by 5 years ago
local char = player.Character or player.CharacterAdded:wait()
local torso = player.Character.Torso
local arms = {char:findFirstChild("Right Arm"), char:findFirstChild("Left Arm")}
local armWelds = {}

--welds arms to torso so that standard humanoid anims doesn't apply to them

local function weldArms()
    if torso and arms[1] and arms[2] then
        local weld = Instance.new("Weld")
        weld.Name = "RightArm"
        weld.Parent = torso
        weld.Part0 = torso
        weld.Part1 = arms[1]
        weld.C1 = CFrame.new(-1.5, 0, 0) * CFrame.Angles(0, 0, 0)
        armWelds[1] = weld -- Welds Right Arm

        local weld2 = Instance.new("Weld")
        weld2.Name = "LeftArm"
        weld2.Parent = torso
        weld2.Part0 = torso
        weld2.Part1 = arms[2]
        weld2.C1 = CFrame.new(1.5, 0, 0) * CFrame.Angles(0, 0, 0)
        armWelds[2] = weld2 -- Welds Left Arm

        --Puts both arms to the side of the player and won't let them move
    end
end

--unwelds arms so that standard humanoid anims apply to them
local function unweldArms()
    if arms and armWelds then
        armWelds[1]:Destroy() -- Unwelds Right plays anims
        armWelds[2]:Destroy() -- Unwelds Left plays anims
    end
end

Found out that welding arms to the torso will make them stiff allowing you to manipulate motor6D, I found this while looking through old scripts which used motor6D animations.

Just connect these functions to an event and there you have stiff arms! :)

Answer this question