If you start by sinply getting the mouse.Hit.p while holding blocks. Then you basically use math.floor to move the position to fit on a grid. On the new position clone an outline block there, and keep the current block position in a variable. Then say on changing mousepos, see if the grid position is different from the old one, if so destroy it and do the code described above.
I’m guessing this might not explain it all the way, but should get you started hopefully
Edit: Think of it as using any grid building tutorial except on mouse move you build a temporary ghost/outline block, then on mouse1 you build the actual block