How to turn this into the object space of a specific part region so that the grid size is relative to that region?

Hi, was watching a B Ricey tutorial on Minecraft style block placing and was wondering how to do it but make it relative to a region part. I’m making a game that uses it and there are maps that duplicate around the baseplate and I have a region part in each of those maps where blocks can be placed. Anything outside of the region can’t have blocks placed.

Is there any way to do this? Thanks.

Script: