Still have questions? Join our Discord server and get real time help.

Log in to vote

5
local number = math.random(20,80) if number == 20 or number == 80 then print("Scouted stat limit reached") end

I wonder if there is a more efficient way to find if the number is 20,25, 30, 35, 40, 45, 50, 55, 60, 65 ,70, 75, or 80. Typing a lot of **if** and **or** statements would take quite a while.

Log in to vote

7
You can simply use the modulus operator. Example:

if number % 5 == 0 then --code end

It just divides by the number you provide and returns the remainder. If the remainder is 0 you know that it is divisible by five or whatever number you put in. I hope this helps and have a great day scripting!

## Locked by User#19524

This question has been locked to preserve its current state and prevent spam and unwanted comments and answers.

Why was this question closed?