Make player's right arm facing the mouse

i made a player look at mouse system for my top down game, but the problem is that the gun shoot where the right arm is, meaning the bullet is not going the way of the mouse, so how would I make my script right arm?

local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()
Mouse.TargetFilter = workspace

repeat wait() until Player.Character; local Character = Player.Character

game:GetService("RunService").RenderStepped:connect(function()
	Character:WaitForChild("Torso").CFrame = CFrame.new(Character.Torso.CFrame.p, Vector3.new(Mouse.Hit.X, Character.Torso.CFrame.p.Y, Mouse.Hit.Z))
end)

I tried this but it spits out a lot of errors

local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()

repeat wait() until Player.Character; local Character = Player.Character
local right = Character:WaitForChild("RightArm")
game:GetService("RunService").RenderStepped:connect(function()
	right.CFrame = CFrame.new(right.CFrame.p, Vector3.new(Mouse.Hit.X, right.CFrame.p.Y, Mouse.Hit.Z))
end)

Instead of RunService use Mouse.Move?

Hmm so like this?

local Player = game:GetService("Players").LocalPlayer
local Mouse = Player:GetMouse()

repeat wait() until Player.Character; local Character = Player.Character
local right = Character:WaitForChild("RightArm")
Mouse.Move:connect(function()
	right.CFrame = CFrame.new(right.CFrame.p, Vector3.new(Mouse.Hit.X, right.CFrame.p.Y, Mouse.Hit.Z))
end)

its says inf yield of right arm, but i thought i waited for it?

I think it is Right Arm with a space in between

ok i tried everything, but the player’s char just smash the ground and stuff, what i am trying to achive here is like battledudes.io

You want to adjust the C0 of the RightArm’s Motor6D, not the CFrame itself.

This is essentially like manually animating your character (ROBLOX configures the C0 values of Motor6D when playing animations).

C0 = CFrame.new(C0.Position, C0.Position + Mouse.Hit.Position) * CFrame.Angles(xradians, yradians, zradians)

(Or something like that)
(Srry for all the edits made some blatant mistakes lol)