To do it with your current technique, it would need a variable to go through the indexes.
Updated
Set Counter to 0
Set matches = 0
While event
Counter < number of children in the array
Sub event of the while event
arrayX[Counter] = X value you’re looking for
Set matches plus 1
Sub event of the while event
Counter plus 1
This would loop through and add 1 to matches if a match was found. If the original number was in the array as well then it would be more the number of ocourances since that number would also be counted.
Alternatively, you could use a for each child with the same technique minus the counter and you wouldn’t compare the variable[index] you would compare the value of the variable in the for each child event(the default variable name is child)
IDK which technique is faster. Also, you. Could use a repeat number of children times.
There are at least 2 methods. Using a while event, you would only need 1 while event. The current events were only increasing the counter when there was a match. So, it got stuck in an endless loop.