So, I'm working on a script that will find the distance between an NPC and (currently) 2 blocks, and move the NPC to which ever block is closest. I'm making the script using Region3 so that it senses all blocks in the area, that way I can add more or less blocks to the area without having to re-write the script. Here's my script:
local base = game.Workspace.Base
local point1 = Vector3.new(0,0,0)
local point2 = Vector3.new(100,100,100)
local Region = Region3.new(point1,point2)
for _,Part in pairs(game.Workspace:FindPartsInRegion3(Region,nil,100)) do
if Part.Name == "building" then
end
end
I'm super stuck at this point. I've tried for hours, but I can't figure out how to make the script get each blocks position individually, instead of combining all the positions into one variable "Part".
Any help on what to do from this point?

2 comments
This is very unnecessarily complicated. You need only .magnitude.
Yes. Lol, just so he can use it expanded without changing much.