https://www.roblox.com/games/1093257255/Place
That is the place I am currently working on, a mining game. See everything works perfectly, except for block regeneration when clicking. I have no idea what is wrong as I have double checked and everything prints properly, etc so it definitely isn't getting hung up from what I can tell. However, there are still no errors & no blocks regenerate. It's uncopylocked so you can see everything, but I believe the issue revolves around this bit of code (ServerScriptService -> BlockRegeneration for the whole script):
if (RegenerationPosition.Y <= 0) then return; elseif (RegenerationPosition.Y <= -6) then local Positions = { Vector3.new(6, 0, 0); Vector3.new(-6, 0, 0); Vector3.new(0, 0, 6); Vector3.new(0, 0, -6); Vector3.new(0, -6, 0); }; for Key, OffsetPosition in next, Positions do local FinalPosition = (RegenerationPosition + OffsetPosition); if (not BlockDetect(FinalPosition)) then PlaceBlock(FinalPosition); end; end; return; else local Positions = { Vector3.new(6, 0, 0); Vector3.new(-6, 0, 0); Vector3.new(0, 0, 6); Vector3.new(0, 0, -6); Vector3.new(0, 6, 0); Vector3.new(0, -6, 0); }; for Key, OffsetPosition in next, Positions do local FinalPosition = (RegenerationPosition + OffsetPosition); if (not BlockDetect(FinalPosition)) then PlaceBlock(FinalPosition); end; end;