# Solved Alternative of +20

Discussion in 'Skript' started by Aralwen, Aug 25, 2018.

Not open for further replies.
1. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
Hello everybody ! I'm looking for an alternative to check that one time is + 20 minutes each time.
Does someone have an idea? Thank you in advance

Code (Skript):
1. if {Time.M} is 20 or 40 or 60 or 80 or 100 or 120 or 140 or 160 or 180 or 200 or 220 or 240 or 260 or 280 or 300:

#1
Post #2 by jaylawl, Aug 25, 2018
3. ### jaylawl Active Member

Joined:
Jan 29, 2017
Messages:
173
31
Code (Skript):
1. if mod({Time.M}, 20) = 0:
2.

#2
• Agree x 1
4. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
Wow, thank you for the quick reply ! It works perfectly, thanks
(I'm definitely not good at mathematics xD)

#3
• Like x 1
5. ### jaylawl Active Member

Joined:
Jan 29, 2017
Messages:
173
31
mod is a shorthand for "modulation". this function (comes with vanilla skript), will remove 20 from {Time.M} until it's no longer greater than 20. the result is the rest.

It's the logical equavalient of doing this:
Code (Skript):
1. while {Time.M} > 20:
2.     remove 20 from {Time.M}

#4
• Informative x 1
6. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
Oh, I did not know. thank you for the explanations
--- Double Post Merged, Aug 26, 2018, Original Post Date: Aug 25, 2018 ---
Excuse me for bothering you again, I would like to know if there is a way also to do that?

Code (Skript):
1. if {Time.M} is 19 or 39 or 59 or 79 or 99 or 119 or 139 ....

#5
7. ### jaylawl Active Member

Joined:
Jan 29, 2017
Messages:
173
31
You should try a bit more on your own
Code (Skript):
1. if mod({Time.M}, 20) = 19

#6
• Friendly x 1
8. ### Aralwen Active Member

Joined:
May 26, 2017
Messages:
164
14
Oh.. I tried if mod({Time.M}, 19) = 0
Thank's T_T

#7
9. ### jaylawl Active Member

Joined:
Jan 29, 2017
Messages:
173
31
modulation = remove Y from X as often as possible with remainder (rest) Z
Code (Skript):
1. mod(X, Y) = Z
You can do it

Code (Skript):
1. mod(wallet, bills) = coins

#8
• Informative x 1
Not open for further replies.