Is there any way to do if not

Hello wick community! Im currently using 1.19.3 and I want to see if
there is anyway to make wick do the opposite of the “if” code
for example:

if not (this.hits§) {
//thing it has to do
}

I tried to do “if not” instead of “if” but it did not work.
any help is appreciated! :slight_smile:

it is if (this.hits§) {
//thing it has to do
} else {
//thing it has to do
}

1 Like

don’t use “if not”

1 Like

a few ways to do this.

you can use an if/else with nothing in the first one, but it’s a waste of space and code.

if(this.hits(thing)) {
    // nothing
} else {
    // something
}

the better way is to use an eclamation mark to denote “not”.

if(!this.hits(thing)) {
    // something
}

your question is more javascript-based than wick-based. while that isn’t a problem and it’s okay to post those questions here (i think), you can probably get a faster and more reliable answer online.

1 Like

That is what @Idro is looking for…

1 Like

your right