wilmer
Member
Greetings to all:
I need help please with this code that I found, I want to use it to put it in a single room, and every time I go to that room, the code will show a random number and discard those that are already coming out. for example from 1 to 9, if it came out 5, it has to go from 1 to 9, any number except the 5. It's for a fight game where I'm going to put random matches, I see that the code is almost ready, but I want to know how to check the number that comes with a DRAW event and know in which event to put the second code.
This goes in the Create event
This is the second code, I do not know in which event to put it.
does not specify me on the page where I found it
And I want to know how to show it with the DRAW event, those two things !!
I need help please with this code that I found, I want to use it to put it in a single room, and every time I go to that room, the code will show a random number and discard those that are already coming out. for example from 1 to 9, if it came out 5, it has to go from 1 to 9, any number except the 5. It's for a fight game where I'm going to put random matches, I see that the code is almost ready, but I want to know how to check the number that comes with a DRAW event and know in which event to put the second code.
This goes in the Create event
Code:
///Controller Object
globalvar numbers;
numbers = ds_list_create();
for(var i = 0; i <= 9; i++)
ds_list_add(numbers, i); //The numbers from 0 to 9 are added
ds_list_shuffle(numbers);
does not specify me on the page where I found it
Code:
///When wanting to get a number
selected = numbers[| 0];
ds_list_delete(numbers, 0);