Hi, thanks for looking at my thread. The editor only allows ranges (f.e. 1 to 10), and not specific numbers (f.e. 2, 7, and 9), which is very limiting. So, in short, I'd like to have a script that can generate a random number from an array.
More specifically, what I need is a script that allows me to put a plugin command something like this: random(4, 7, 99, 102). This should generate either number 4, number 7, or number 99, and stores the drawn number in variable 102 (so the last number is the variable it should be stored at). I hope this is clear, I'm not sure how to explain it better. Just to be clear, I really need it to be a plugin command I can call from the editor, not pre-defined arrays from the script.
I will personally only need to generate a random number from arrays of exactly 10 numbers. However, if you'd like to post this script for others as well, it may be better to leave the length of the array up to the user (this is probably more difficult to code?). The last number should always be the variable number the random number will be stored at.
Thanks in advance if you can help me! Of course, you will be credited in my game (I plan to upload it here on the forums once it's done).