And/Or conditions

  • 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 community!

    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.
G

Goetheus

Hi everybody!

I would like to know if we can use "or" with conditions?

I know there are lambdas:
[condition 1]->[condition 2] = "condition 1 + condition 2"

But I don't know for "or".

Thank you for help!
Kiss <3
 
You can do this workaround:
code_language.skript:
if check [first condition] and check [second condition] are true and false or false and true:
 
  • Like
Reactions: Goetheus
You can do this workaround:
code_language.skript:
if check [first condition] and check [second condition] are true and false or false and true:
Or simply this:
code_language.skript:
If [first condition] is true:
    #do stuff
    Stop
If [second condition] is true:
    #do same stuff
    Stop
so you have: if first or second condition is true: do something
 
  • Like
Reactions: Goetheus
Or simply this:
code_language.skript:
If [first condition] is true:
    #do stuff
    Stop
If [second condition] is true:
    #do same stuff
    Stop
so you have: if first or second condition is true: do something
but... that'd require more code than needed
 
Or simply this:
code_language.skript:
If [first condition] is true:
    #do stuff
    Stop
If [second condition] is true:
    #do same stuff
    Stop
so you have: if first or second condition is true: do something
That would be the same as do:
code_language.skript:
if check [first condition]->[second condition]:
I think what you meant this:
code_language.skript:
if first condition is true:
    if second condition is false:
        #do stuff
else:
    if condition is true:
        #do more stuff
But as you can see, it's easier to do in the way I did it.
 
  • Like
Reactions: Goetheus
But it's a solution :emoji_sunglasses:
The

check [Lamba here]->[more conditions]

Is a custom checking system built into SkQuery. Pyon was using lambas []. You might have thought he ment put your condition here. But it actually gets the [ ] brackets.
 
Oh! Thank you for your answers guys!
I'll check it out!
 
Status
Not open for further replies.