I'm trying to implement a random password generator to open a door in the game, but to find the password, the player needs to find a paper with the password written in it, but actually i dont know how to do this.
Someone know how to implement this?
I'll go over one possible way to do this using only events. To do this you'll need to understand how to use variables. I will assume your scenario is as follows: the player is trying to get through a passworded door. The player can find an event, a piece of paper, that has the number written on it, but they cannot take the paper with them, so they must remember the number. I will assume a 5 digit number. As with most of my explanations, the key step is to break your task into as many small pieces as you can.
First, you will have to decide when the number is generated. It could be at the very start of the game and is a piece of data that is carried along the entire game until it is needed. An alternative is, the number is generated at the moment you enter the area with the passworded door. Whichever it is, you must make sure not to overwrite the number in the variable editor until you're sure it will never be used again.
Then, you generate the number. For 5 digits, you want a number between 0 and 99999. From the Event Editor, go to Control Variables... and create a new one called "Locked Door Passcode". Press the Set" bubble and choose random, a number between 0 and 99999. Once this event runs, you will have your number. This number will persist between saves, as long as you don't call "Control Variables..." on this variable again. Make note of the number next to your new variable, as you will need it in the next step. Let's assume it's "123: Locked Door Passcode".
Next, you want your paper event to display the number in a basic message window. You create the event, Open the "Show Message..." option, and write something like "The password is \V[123]". This instructs RPG Maker to insert the value stored in Variable #123, our "Locked Door Passcode" into the message window. If you test it with the "preview" button, it will show a zero, but that's because all variables are zero by default. This will tell the player the random number we generated.
Now for the door. You can use the "Input Number..." option and select 5 digits, and set the variable to a new variable, for example "124: Passcode Input". This will store the 5 digit number you enter as a new variable. Then, you compare this variable to your previous variable using a Conditional Branch. If the two numbers are equal, then the door should open. In the "else" case, the password the player input is wrong, and the door shouldn't open.
I made this very basic so apologies if this is too basic or even too advanced for the advice you were looking for, but the kind of thing you're after is definitely possible without any scripting at all. Hope this helps!