How do I make a characters tool follow the camera on the X axis

  1. What do you want to achieve? Keep it simple and clear!

  2. What is the issue? All attempts ive tried have failed

  3. What solutions have you tried so far? Repeating the code for the Y axis on the X axis

current code:

local function flashlight(player,X,Y,reset) --X and Y are lookVector X and Y
	if player.Character and player.Character:FindFirstChild(script.Name) and not reset then
		player.Character.Torso["Right Shoulder"].C0 = CFrame.new(player.Character.Torso["Right Shoulder"].C0.Position) * CFrame.Angles(0,math.rad(90),math.rad(Y*70))
	else
		player.Character.Torso["Right Shoulder"].C0 = CFrame.new(player.Character.Torso["Right Shoulder"].C0.Position) * CFrame.Angles(0,math.rad(90),0)
	end
end
game.ReplicatedStorage.flashlight.OnServerEvent:Connect(flashlight)
game.ReplicatedStorage.flashlight1.OnServerEvent:Connect(flashlight)

this code only has the X axis

this code fixed it

local function flashlight(player,X,Y,reset) --X and Y are lookVector X and Y
	if player.Character and player.Character:FindFirstChild(script.Name) and not reset then
		player.Character.Torso["Right Shoulder"].C0 = CFrame.new(player.Character.Torso["Right Shoulder"].C0.Position) * CFrame.Angles(0,math.rad(-X*70)+math.rad(90),math.rad(Y*70))
	else
		player.Character.Torso["Right Shoulder"].C0 = CFrame.new(player.Character.Torso["Right Shoulder"].C0.Position) * CFrame.Angles(0,math.rad(90),0)
	end
end
game.ReplicatedStorage.flashlight.OnServerEvent:Connect(flashlight)
game.ReplicatedStorage.flashlight1.OnServerEvent:Connect(flashlight)