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

Script that makes the player's right arm not correctly positioned after animated. How to fix?

Asked by 7 years ago
Edited 7 years ago

This script is for a animation and I want to make it so it returns to the normal character's look rather then the arm getting more twisted for a weird reason.

player = game:GetService("Players").LocalPlayer
mouse = player:GetMouse()
character = player.Character
debounce = false
mouse.KeyDown:connect(function(k)
    local key = k:lower()
    if key == "e" and debounce == false then
        local torso = character:WaitForChild("Torso")
        local rs = torso["Right Shoulder"]
        debounce = true
        for i = 1,10 do
            rs.C0 = rs.C0 * CFrame.Angles(0, 0, 0.18)
            rs.C0 = rs.C0 * CFrame.Angles(0, 0.15, 0)
            wait(0.025)
        end
        for i = 1,10 do
            rs.C0 = rs.C0 * CFrame.Angles(0, 0, -0.18)
            rs.C0 = rs.C0 * CFrame.Angles(0, -0.15, 0)
            wait(0.025)
        end
        debounce = false
    end
end)

Should I substitute something? Use another instance? Also if you could give me a related wiki reference page associated with your answer, that would be nice!

Answer this question