Position is not a valid member of part?

I am trying to subtract a parts Center position by another parts magnitude
MainCenterPosition is the position of the middle of Part1
function GetNumber(Part)
local Number = MainCenterPosition - Part.Position.Magnitude
end

and i get this error

Position is not a valid member of Part2

Edit: I managed to get it working

You can’t subtract a parts magnitude from a parts position and you have most likely messed up in your code elsewhere. If you can provide more detail I may be able to help.

Make sure Part2 is a BasePart. By the way, you can put your code in a code block by putting 3 backticks at the beginning and end.