How can I write a condition using this ArrayTools::IndexOf event?

How can I write a condition using this ArrayTools::IndexOf event?

I am writing an event to check for existence using the value of the array variable.

I tried asking using Gemini, but since there is no direct event to check for existence, I was advised to use the IndexOf event.

So Im writing…

image

What went wrong and how can I fix it?

There are conditions to check if a value exists in the search array or after a certain position. It looks like you’re using an expression in a compare condition. Is it showing an error message below the red squiggle?

You can use one of the conditions under other depending if it’s a scene or object variable.

See also:

https://wiki.gdevelop.io/gdevelop5/extensions/array-tools/#array-tools