Move tool with players hand

I have an issue with tool following nand movement, any way to fix it?


The code is

local run = game:GetService("RunService")
local tool = script.Parent
local equipped = false
local Player = game.Players.LocalPlayer
local mouse = Player:GetMouse()
local char = Player.Character or Player.CharacterAdded:Wait()

tool.Equipped:Connect(function()
	equipped = true
end)

run.RenderStepped:Connect(function()

	if equipped then
		local rightX, rightY, rightZ = char.Torso["Right Shoulder"].C0:ToEulerAnglesYXZ()
		char.Torso["Right Shoulder"].C0 = (char.Torso["Right Shoulder"].C0 * CFrame.Angles(0, 0, -rightZ)) * CFrame.Angles(0, 0, math.asin((mouse.Hit.p - mouse.Origin.p).unit.y))

		local leftX, leftY, leftZ = char.Torso["Left Shoulder"].C0:ToEulerAnglesYXZ()
		char.Torso["Left Shoulder"].C0 = (char.Torso["Left Shoulder"].C0 * CFrame.Angles(0, 0, -leftZ)) * CFrame.Angles(0, 0, math.asin((-mouse.Hit.p - -mouse.Origin.p).unit.y))
	end
end)
1 Like

I think the ak is incorrectly welded. Try again

Appears that its welded to torso, so gun replicates only to torso rotating.