# Help with a maths expression

Get help using Construct 2

### » Mon Feb 22, 2016 12:35 am

Message: Landermere can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
Hello there fellow nerds!
I am trying to run a conditional check within an array to see if a number contained is one of two values.
I know that | is the "Or" symbol and so by checking if array = 1 | 5, this should see if the value is either 1 or 5.
This does not seem to work and is yielding unwanted results.

http://pasteboard.co/1JpLXlsg.png

Expressions I have tried:

if Stance_Array = (1)|(5) play animation
if Stance_Array = 1|5 play animation
if Stance_Array = (1|5) play animation
if Stance_Array = ((1)|(5)) play animation

I'm not sure If I'm misunderstanding expressions but...Help please
Chris
B
8
S
1
Posts: 46
Reputation: 544

### » Mon Feb 22, 2016 1:39 am

(Stance_Array = 1) | (Stance_Array = 5)
B
71
S
22
G
279
Posts: 3,838
Reputation: 153,873

### » Mon Feb 22, 2016 3:28 am

Message: Landermere can only post plain text URLS until they have 500 rep. 1 URLS modified. Why?
I hadn't thought of doing that however, Unfortunately that didn't work either :/
I have however figured out a work around but still leaves the question as to why it didn't work.

Solution to my issue is linked here
http://pasteboard.co/1JB2Kvun.png

B
8
S
1
Posts: 46
Reputation: 544

### » Mon Feb 22, 2016 3:35 am

You can convert an AND block into an OR block by right-clicking and choosing "Make 'Or' block".
B
71
S
22
G
279
Posts: 3,838
Reputation: 153,873

### » Mon Feb 22, 2016 10:10 am

@blackhornet ooooh I did wonder what that feature actually did!
I'm going to try that out
Thanks for the knowledge <3
stay awesome
Chris
B
8
S
1
Posts: 46
Reputation: 544