Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
✓ ANSWER ACCEPTED

What does the percentage symbol % do in the script ?

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.

1 answer

✓ Accepted answer

% 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

2 comments

0

Thanks, I have no idea how I've forgotten such a vital thing ???????

0

no problem, it happens

This discussion is preserved as it was. New answers, comments, and votes are closed.