I'm trying to make it so that when the player has the Tool AK-47 selected Move the Rightshoulder and neck at the same time and when deselected have only the Neck move at once instead of both Right shoulder and neck. But instead it makes both the Camera.Changed:connect(function()'s go off at the same time when I have the gun selected.
local Camera = game.Workspace.CurrentCamera local human = game.Players.LocalPlayer.Character while true do if game.Players.LocalPlayer.Backpack:FindFirstChild("AK-47") then Camera.Changed:connect(function() human.Torso.Neck.C1 = CFrame.new(); human.Torso.Neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin(Camera.CoordinateFrame.lookVector.Y), 0, 0); human.Torso["Right Shoulder"].C0 = CFrame.new(1, 0.5, 0) *CFrame.Angles(math.rad(0), math.rad(90), math.rad(0)) end) elseif game.Players.LocalPlayer.Character:FindFirstChild("AK-47") then human.Torso.Neck.C1 = CFrame.new(); human.Torso.Neck.C0 = CFrame.new(0, 1.5, 0) * CFrame.Angles(math.asin(Camera.CoordinateFrame.lookVector.Y), 0, 0); human.Torso["Right Shoulder"].C0 = CFrame.new(0.5, 0.5, 0.5) *CFrame.Angles(math.rad(0), math.rad(90), math.rad(0))* CFrame.Angles(0, 0, math.asin(Camera.CoordinateFrame.lookVector.Y)); end wait() end