1. 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!

  2. LOOKING FOR A VERSION OF SKRIPT?

    You can always check out our Wiki for downloads and any other information about Skript!

Dismiss Notice
This site uses cookies. By continuing to use this site, you are agreeing to our use of cookies. Learn More.

Solved Alternative of +20

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

Thread Status:
Not open for further replies.
  1. Aralwen

    Aralwen Active Member

    Joined:
    May 26, 2017
    Messages:
    164
    Likes Received:
    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:
     
  2. Best Answer:
    Post #2 by jaylawl, Aug 25, 2018
  3. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    31
    Code (Skript):
    1. if mod({Time.M}, 20) = 0:
    2.  
     
    • Agree Agree x 1
  4. Aralwen

    Aralwen Active Member

    Joined:
    May 26, 2017
    Messages:
    164
    Likes Received:
    14
    Wow, thank you for the quick reply ! It works perfectly, thanks :emoji_slight_smile:
    (I'm definitely not good at mathematics xD)
     
    • Like Like x 1
  5. jaylawl

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    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}
     
    • Informative Informative x 1
  6. Aralwen

    Aralwen Active Member

    Joined:
    May 26, 2017
    Messages:
    164
    Likes Received:
    14
    Oh, I did not know. thank you for the explanations :emoji_grinning:
    --- 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 ....
     
  7. jaylawl

    jaylawl Active Member

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

    Aralwen Active Member

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

    jaylawl Active Member

    Joined:
    Jan 29, 2017
    Messages:
    173
    Likes Received:
    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 :emoji_slight_smile:

    Code (Skript):
    1. mod(wallet, bills) = coins
     
    • Informative Informative x 1
Thread Status:
Not open for further replies.

Share This Page

Loading...