I've tried finding answers but couldn't find it, can someone tell me what the "%" does so that I can have a better understanding of what others have coded.
%
is a mathematical operator named modulo. It returns the remainder of the division between two numbers. For example:
print(2%2) --prints 0 because 2 goes into 2, 1 time evenly. print(5%2) --prints 1 because 2 goes into 5, 2 times, leaving 1 behind