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 How to check if multiple variables are true?

Discussion in 'Skript' started by lonelypotato99, May 27, 2020.

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

    Joined:
    May 27, 2020
    Messages:
    4
    Likes Received:
    1
    I'm relatively new to skript, so work with me here,

    I have a parkourdone::%player%.easy variable that goes from easy on the end to medium, hard, and extra hard. The variables are set to true or false at a certain point, but how can I check if all 4 variables are true at one point?
    Example:

    Code (Text):
    1. on rightclick on a sign:
    2.      1st line of clicked block is "Parkour Finished!"
    3.      if {parkourdone::%player%.easy} is true and {parkourdone::%player%.medium} is true...
    4.      #do stuff
    and so on up till extra hard.
    Obviously that third line of code doesn't exist within skript, so how can I check the value of multiple variables at once? (Similar to java's ||).
     
  2. Best Answer:
    Post #2 by WeeHee, May 27, 2020
  3. WeeHee

    WeeHee Active Member

    Joined:
    Mar 4, 2017
    Messages:
    108
    Likes Received:
    21
    You would do a new line for each condition.

    Code (Text):
    1. if {parkourdone::%player%.easy} is true:
    2.     if{parkourdone::%player%.medium} is true:
     
  4. lonelypotato99

    Joined:
    May 27, 2020
    Messages:
    4
    Likes Received:
    1
    Oh duh, I didn't even think of that. Works great, thank you very much!
     
    WeeHee likes this.
Thread Status:
Not open for further replies.

Share This Page

Loading...