I need help making a Grid Based Formula that ignores an object's rotation/tilt

Look into these posts:

They show how to solve your problem

function Round(x, mult)
	return math.floor((x / mult) + 0.5) * mult
end

– made by sleitnick in the second link I provided