Hello again everyone, and happy new year.
I'm trying to let the game generate a random number (0-3), based on the outcome, the NPC (Called Leo) will move to one on four locations (3,10; 5,10; 7,10; and 9,10).
After that, the outcome will be removed from the array, and loop again till no elements are in the array.
This is what I have now with a script:
let myArray = [0,1,2,3]
let x = Math.floor((Math.random() * 4) + 1);
myArray.splice(x);
The problem is that at this point, I don't know if to copy x to a Game Variable 0042 (and I don't know how to do that) and work with inbuilt functions, or to continue with the script (and I don't know how to do that).
Do you have any suggestion?
Thank you in advance 🙂
I'm trying to let the game generate a random number (0-3), based on the outcome, the NPC (Called Leo) will move to one on four locations (3,10; 5,10; 7,10; and 9,10).
After that, the outcome will be removed from the array, and loop again till no elements are in the array.
This is what I have now with a script:
let myArray = [0,1,2,3]
let x = Math.floor((Math.random() * 4) + 1);
myArray.splice(x);
The problem is that at this point, I don't know if to copy x to a Game Variable 0042 (and I don't know how to do that) and work with inbuilt functions, or to continue with the script (and I don't know how to do that).
Do you have any suggestion?
Thank you in advance 🙂