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

How do I make an arm stay at its side while a tool is equipped?

So I have a tool that I am trying to weld to the back of the torso. I want this to happen when a button on a GUI is pressed. This GUI is already coded to only appear when a tool is equipped. My only problem is that when I weld the tool to the back of the torso, the right arm of the character follows. I don't want this so how can I make it so the arm stays at the side of the character, just as if the character didn't have a tool equipped? Here's the code I use to weld the tool to the side of the character:

local torso = character.Torso
local handle = character:FindFirstChild("Lantern").Handle
local weld = Instance.new("Weld")
weld.Name = "BackWeld"
weld.Part0 = torso
weld.Part1 = handle
weld.C0 = CFrame.new(-1,-1.02,0.5)
weld.C0 = weld.C0 * CFrame.fromEulerAnglesXYZ(math.rad(-170),math.rad(-180),-20.5)
weld.Parent = handle

2 comments

0

In tool property, you can change GripPos! No need script.

0

To accomplish what I needed, I actually just deleted the "RightGrip" inside of the "Right Arm".

2 answers

✓ Accepted answer

The reason why tools aways cause a player's arm to move up is because of the Animate script within each Player Character. The simplest and easiest way I can think of to disable the arm movement within the Animate script is by commenting -- line 729 which is: animateTool()

Let me walk you through what to do so all characters spawn without the animateTool function being called.

First open up a place in studio then press the Play button that is Blue with a character on it. After you spawn into your game, find your name in Workspace then open up your "Tree".

Now you should find a script named Animate, do NOT change this name! Make sure to copy the script by right-clicking it then press the Copy option. Now you may press the red box on the top left to close the test.

Almost done, all we need to do is open the tree for StarterPlayer and paste our Animate script into StarterCharacterScripts.

Do not forget to actually edit the script, if you have not done so at this point, double click the script to open it and find line 729 and put two - before the text. You should get --animateTool() when you're done and the color will change. Now just save your game and you are done!

2 comments

0

The one problem with this is that I want it to be toggle-able.

0

Playing animations to move the arm should suffice. As long as you get the tool back into position, the animation will move the arm with the connect tool.

You can do something like this:

tool.Equipped:connect(function()
    local partToFix = tool.GripPart 
    local weld = Instance.new("ManualWeld", partToFix)
    weld.Part0 = tool.Parent.RightHand
    weld.Part1 = partToFix
    weld.C0 = CFrame.new(0,-.5,-.5)
end)

tool.Unequipped:connect(function()
    weld:Destroy()
end)

Source

You can also just make a stationary animation and play it while the user has the tool equipped.

4 comments

0

Alright, I'll test out the code right now. The problem with the stationary animation is if the player wanted to walk

0

Yeah, it didn't seem to work. Is it possible that there are welds stopping it from working correctly?

0

Thats why i said you can do something LIKE it, its not copy paste for your situation.

0

Yeah, I didn't copy paste, the only part I used was the weld and it didn't work for me.

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