how to do a limit for raycasting

I saw this video https://www.youtube.com/watch?v=A0c8zM2xAHM is there to go without adding a scoreboard in the laser function to count for each 0.5 block that it moves on?

Continue to help post