• Hey Guest! Ever feel like entering a Game Jam, but the time limit is always too much pressure? We get it... You lead a hectic life and dedicating 3 whole days to make a game just doesn't work for you! So, why not enter the GMC SLOW JAM? Take your time! Kick back and make your game over 4 months! Interested? Then just click here!

Legacy GM If number is already in array [SOLVED] (Thanks to "whale_cancer")

J

Julian244

Guest
Hey, im trying to check if a number is already in a (1d)array but i dont know how i can do this.....

and sorry for my bad english....
 
W

whale_cancer

Guest
You could use a for loop to go through the array and then set a variable if it finds the number you are looking for.

Alternatively, you could use a ds_list instead of an array. ds_lists have a built in function to find values in them and are otherwise very much like arrays.
 
J

Julian244

Guest
You could use a for loop to go through the array and then set a variable if it finds the number you are looking for.

Alternatively, you could use a ds_list instead of an array. ds_lists have a built in function to find values in them and are otherwise very much like arrays.
i already tried it with a foor loop but my friend told me something about a list in c# and i didnt knew that theres a list in gml too thanks i will try it and ask my friend^^
 
Top