Solved Alternative of +20

  • Welcome to skUnity!

    Welcome to skUnity! This is a forum where members of the Skript community can communicate and interact. Skript Resource Creators can post their Resources for all to see and use.

    If you haven't done so already, feel free to join our official Discord server to expand your level of interaction with the comminuty!

    Now, what are you waiting for? Join the community now!

  • LOOKING FOR A VERSION OF SKRIPT?

    You can always check out skUnity Downloads for downloads and any other information about Skript!

Status
Not open for further replies.

Aralwen

Active Member
May 26, 2017
164
14
18
25
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_language.skript:
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:
 
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_language.skript:
while {Time.M} > 20:
    remove 20 from {Time.M}
 
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_language.skript:
while {Time.M} > 20:
    remove 20 from {Time.M}
Oh, I did not know. thank you for the explanations :emoji_grinning:
[doublepost=1535296217,1535156759][/doublepost]Excuse me for bothering you again, I would like to know if there is a way also to do that?

code_language.skript:
if {Time.M} is 19 or 39 or 59 or 79 or 99 or 119 or 139 ....
 
You should try a bit more on your own
code_language.skript:
if mod({Time.M}, 20) = 19
 
modulation = remove Y from X as often as possible with remainder (rest) Z
code_language.skript:
mod(X, Y) = Z
You can do it :emoji_slight_smile:

code_language.skript:
mod(wallet, bills) = coins
 
Status
Not open for further replies.