Help with custom gun

You can write your topic however you want, but you need to answer these questions:

  1. What do you want to achieve? Keep it simple and clear!
    I’ve recently tried to make my own gun system and it works pretty well but when i tried to make it so it detects where the player is aiming at to fire at that position, it rotates the whole body to shoot to that spot instead of only rotating the invisible Muzzle part welded to the weapon that is where the bullet comes out of.
  2. What is the issue? Include screenshots / videos if possible!
    mouse
    Thats the problem, when you shoot with that on, instead of only rotating the part i want to rotate it rotates the whole body and generally turning it upside down or even allowing you to noclip on walls to get past them, that is definitelly something i dont want.
  3. What solutions have you tried so far? Did you look for solutions on the Developer Hub?
    Tried some stuff with constraints, creating more parts, mostly created more problems.
    After that, you should include more details if you have any. Try to make your topic as descriptive as possible, so that it’s easier for people to help you!
RemoteEvent.OnServerEvent:Connect(function(Player, Received) -- "Received" Mouse position
	if loadedv.Value == 1 and deb == false then
		deb = true
		loadedv.Value = 0
		local projectile = game.ReplicatedStorage.Bullet:Clone()
		local shootpart = tool.Handle:WaitForChild("Muzzle")
		local spot = Received.Position
                shootpart.CFrame = CFrame.new(shootpart.Position, spot) -- muzzle part faces mouse position
		projectile.Parent = workspace
		projectile.Position = shootpart.Position
		projectile.Velocity = shootpart.CFrame.LookVector * speed -- shoots the bullet

Please do not ask people to write entire scripts or design entire systems for you. If you can’t answer the three questions above, you should probably pick a different category.