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.

Comparing two variables

Discussion in 'Skript' started by HKPNW-Owner, Apr 2, 2019.

Thread Status:
Not open for further replies.
  1. HKPNW-Owner

    HKPNW-Owner Member

    Joined:
    Feb 2, 2017
    Messages:
    33
    Likes Received:
    0
    Hello! I'm writing a skript which i'm trying to compare two variables are same or not. It's something like that:

    Code (Text):
    1.         if {warnings.%arg-1%} contains {warning.chances}:
    2.             wait 5 tick
    3.             set {ban.command} to yaml value "PunishmentSK.Punish.Command" from file "plugins\PunishmentSK\config.yml"
    4.             make console execute "%{ban.command}% %arg-1%"
    5.         else:
    6.             add 1 to {warnings.%arg-1%}
    But it's not working at all. I'm trying to compare {warnings.%arg-1%} with {warning.chances} if they are same or not. How can i do that?
     
  2. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    Use if {_var1} is {_var2}
     
  3. Marsbar

    Marsbar Active Member

    Joined:
    Mar 31, 2019
    Messages:
    131
    Likes Received:
    4
    --- Double Post Merged, Apr 6, 2019, Original Post Date: Apr 2, 2019 ---
    maybe use "is bigger than" or "is smaller than"
     
    #3 Marsbar, Apr 6, 2019
    Last edited: Apr 7, 2019
  4. TPGamesNL

    Supporter Addon Developer Dev Programme

    Joined:
    Jan 20, 2018
    Messages:
    1,500
    Likes Received:
    107
    Medals:
    He's trying to see if they're the same...
     
  5. Juffix

    Juffix Member

    Joined:
    Apr 7, 2019
    Messages:
    19
    Likes Received:
    4
    Use - if {warnings.%arg-1%} is equal to {warning.chances}:
     
Thread Status:
Not open for further replies.

Share This Page

Loading...