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

How do I check if a number is a multiple of 10/increased by 10?

Say number = 0, and number increases by 1 each second.

How would I check if number is equal to a multiple of 10 (e.g. do something when number = 10, 20, 30 etc.)

1 comment

0

You can use the modulo operand: (a % 10 == 0)

2 answers

✓ Accepted answer
if number % 10 == 0 then
	--code
end

This checks to see it there is a remainder when the number is divided by 10. If not, run the code.

you need to check if the number is divisible by 10, you can do this by doing

if number % 10 == 0 then

end

and you can have this fire once the number changed by doing a .Changed event

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