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

How do I make animations on Tool equipped?

Asked by 10 years ago

Hi, guys! I want to make a Tool so that whenever a player equips it, the player's Left Arm and Right Arm changes angles and position. (Kind of like playing an animation) Anyways, I figured out how to change the angles of both like so: (The following is only the small animation portion of an entire script. Don't worry about the Player not being stated and stuff!)

tool.Equipped:connect(function(mouse)
    local RightShoulder = Player.Character.Torso["Right Shoulder"]
    local LeftShoulder = Player.Character.Torso["Left Shoulder"]
    RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(0,0.6,0)
    LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0,-0.5,0)
end)
tool.Unequipped:connect(function(mouse)
    reload:Play()
    local RightShoulder = Player.Character.Torso["Right Shoulder"]
    local LeftShoulder = Player.Character.Torso["Left Shoulder"]
    RightShoulder.C0 = RightShoulder.C0 * CFrame.Angles(0,-0.6,0)
    LeftShoulder.C0 = LeftShoulder.C0 * CFrame.Angles(0,0.5,0)
end)

The script above works fine, and I think I got the concept of how to change the Arms' angles. What I DON'T know is how to change their position. If anyone could help me solve this problem, I would highly appreciate it! --Thanks in advance!

1 answer

Log in to vote
5
Answered by 10 years ago

To change there position, just change the cframe.

rightshoulder.C0 = CFrame.new(1.4, 0, 0)*CFrame.Angles(0,-.6,0)

Just test the offset, till you get the one you wont :)

If this helped like this answer :)

0
Thanks. But how do I get the CFrame off when the tool is unequipped? What are the numbers? dpark19285 375 — 10y
1
I think CFrame.new(-1.4,0,0) for left then the oppisite for right. If you could like this answer if it helped that would be great :) User#5978 25 — 10y
Ad

Answer this question