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.

using "||" in "if" statement

Discussion in 'Skript' started by dudle, Apr 13, 2018.

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

    dudle Active Member

    Joined:
    Jan 31, 2017
    Messages:
    135
    Likes Received:
    0
    Can I use the "||" or "&&" in the skript if statement just like in java or is there any other way?

    What I want to do is check if either of the specified variables in the if statements exist/are true. Is there a way to do this or do I need to check for each of the variables separately?
     
  2. ShaneBee

    Moderator Resource Staff Supporter + Addon Developer

    Joined:
    Sep 7, 2017
    Messages:
    2,184
    Likes Received:
    225
    depending how you are doing it, you could do something like

    if {variable} contains "yes" or "no":
     
  3. dudle

    dudle Active Member

    Joined:
    Jan 31, 2017
    Messages:
    135
    Likes Received:
    0
    if {var} is true || if {var} is not set

    how can I do this?
     
  4. Snow-Pyon

    Moderator Resource Staff

    Joined:
    Jan 25, 2017
    Messages:
    1,236
    Likes Received:
    176
    Medals:
    If you need this, it is because you're doing something wrong. Please explain the exact issue and I might be able to help out.
     
  5. dudle

    dudle Active Member

    Joined:
    Jan 31, 2017
    Messages:
    135
    Likes Received:
    0
    Already explained.. Ain't doing anything wrong, I need this to make something work. Ain't an issue, but a question I need a solution for
     
  6. Snow-Pyon

    Moderator Resource Staff

    Joined:
    Jan 25, 2017
    Messages:
    1,236
    Likes Received:
    176
    Medals:
    you didn't explain anything, this is just another XY problem that could be solved by using something else in a different way. For example, boolean variables.

    The thing is: conditions list statements aren't a thing in Skript, but there aren't many cases where you actually need them, if you need it then you're probably doing something wrong.
     
Thread Status:
Not open for further replies.

Share This Page

Loading...