How would I make a part spawn where I click, and be positioned and coming from the tool I'm holding?

I’m trying to make a gun that when you click (shoot) a kinda like laser comes out of the gun and highlights where you have clicked. My solution to this was to make a part(laser) that comes out of the gun. but no matter what I do the part never connects with the gun.

local i = 0

gun.Anchored = false

tool.Equipped:Connect(function(Mouse)
gui.Enabled = true
usr.InputBegan:connect(function(input)
if input.KeyCode == Enum.KeyCode.R then
reload = true
gui.TextLabel.Text = “Reloading…”
wait(2)
i = 0
gui.TextLabel.Text = “15/15”
reload = false
end
end)

Mouse.Button1Down:Connect(function()
	if i < 15 and reload == false then
		local tracer = Instance.new("Part")
		local bullets = Instance.new("Part")
		local x2 = mouse.Hit.Position.X
		local y2 = mouse.Hit.Position.Y
		local z2 = mouse.Hit.Position.Z
		tracer.Size = Vector3.new(math.abs(gun.Position.X-x2), 1, 2)
		print(tracer.Size)
		tracer.Position = Vector3.new(x2, y2, z2)
		tracer.Parent = game.Workspace
		bullets.Size = Vector3.new(1, 1, 1)
		bullets.Anchored = true
		bullets.CanCollide = false
		bullets.CFrame = CFrame.new(x2, y2, z2)
		bullets.Parent = game.Workspace
		i+= 1
		gui.TextLabel.Text = 15-i.."/15"
		wait()
		bullets:Destroy()
	end
end)

end)
tool.Unequipped:Connect(function()
gui.Enabled = false
end)

You should be able to do bullets.CFrame = CFrame.new(mouse.Hit.Position, tool.Position)

Hmm I got an error:
Position is not a valid member of Tool “Workspace.PROGAMERRICH231.Gun”

Oh. Can you send a screenshot of the items in the tool.

Capture

Replace tool.Position with tool.Handle.Position