Hey there, so I’ve been trying to create a server-sided script that rotates the players arms whenever they begin sprinting, reason for this is because when the player sprints and swing their weapon, the weapon swings towards the ground due to the animation, I’m trying to position the arms up using CFrames so that when ever they begin sprinting with a weapon the arms fix themself back tot he original position without having to edit the animation. Though after trying to create a the script i have been running into this issue where the arms are not positioned correctly and are moved towards the torso and head and rotating improperly. Any solution to this?
Issue example link: https://gyazo.com/54302803401e0305ef5159b867c849df
Script:
local hum = owner:WaitForChild("Humanoid")
fixposition = game.ReplicatedStorage.Events:WaitForChild("FixArms")
local origRightS = owner:WaitForChild("Torso"):WaitForChild("Right Shoulder").C1
local origLeftS = owner:WaitForChild("Torso"):WaitForChild("Left Shoulder").C1
tool.equipped:Connect(function()
fixposition.OnServerEvent:Connect(function(Player, sprint)
if Player and sprint == 35 then
owner.Torso["Right Shoulder"].C1 = CFrame.Angles(0, 0, math.rad(-50))
owner.Torso["Left Shoulder"].C1 = CFrame.Angles(0, 0, math.rad(-50))
else
owner.Torso["Right Shoulder"].C1 = CFrame.Angles(0, 0, 0)
owner.Torso["Left Shoulder"].C1 = CFrame.Angles(0, 0, 0)
end
end)
end)
tool.Unequipped:Connect(function()
owner.Torso["Right Shoulder"].C1 = CFrame.Angles(0, 0, 0)
owner.Torso["Left Shoulder"].C1 = CFrame.Angles(0, 0, 0)
end)