Help with error

so I was making a game, then an error pops up on one of my blocks! I have no idea how to fix it, and I am very comfuzzled. here are some screenshots


Screenshot 2025-05-03 15.46.39 here is the link https://makecode.com/_VqHekbRAfWuz
I am using better arrays extension for this, and it works perfectly fine if I use “find index of” instead of that, so I’ma just ping Mr. @Sarge because he might know what’s going on.

4 Likes

The “find occurrences of ()” block outputs an array of all the things it found. So to find the number of things it found, you can use “length of array”:

2 Likes

Oh also @MakeCode it really seems like a bug that the error warning appeared there instead of on the yellow block. Idk if it is or not, but it’s certainly very weird imo.

2 Likes

Pro tip: all the functions in the extensions are fully annotated! So if you hover over a block it should give you a tip on what it returns.

(as @WoofWoof pointed out, this block returns an array of indices, and you were comparing it to a single index)

Hope this helps in preventing some future issues!

2 Likes

Thanks Mr @Sarge and @WoofWoof ! it works perfectly!

2 Likes