I was just about to publish an edit to my earlier post when you posted this. While I was thinking about this problem I found a much cleaner way of doing this with the help of script calls. The way it'll work is it will ask the player to choose an item and then remove the item they chose. It'll do this three times and then check to see if the items that the player put on the shelf were the correct ones. If yes then you open the passage else it will return the items that were placed on the shelf.
a screenshot showing what's going on:
By the way you will need 3 different variables for this. In the screenshot the variables I used were name "first" "second" "third". The names aren't important, just wanted to make sure you could recognize them in the picture. You will need to know the IDs of the variables and items you will be using though.
The scripts calls I used (make sure each line is in a different script call):
Change X, Y, and Z into the IDs of the variables you are using.
$gameParty.loseItem($dataItems[$gameVariables.value(X)], 1);
$gameParty.loseItem($dataItems[$gameVariables.value(Y)], 1);
$gameParty.loseItem($dataItems[$gameVariables.value(Z)], 1);
$gameParty.gainItem($dataItems[$gameVariables.value(X)], 1);
$gameParty.gainItem($dataItems[$gameVariables.value(Y)], 1);
$gameParty.gainItem($dataItems[$gameVariables.value(Z)], 1);
And this is the script used in the conditional branch:
Change X, Y, and Z into the IDs of the variables you are using
Change A, B, and C into the item IDs of the correct books
($gameVariables.value(X) === A && $gameVariables.value(Y) === B && $gameVariables.value(Z) === C)||($gameVariables.value(X) === A && $gameVariables.value(Y) === C && $gameVariables.value(Z) === B )||($gameVariables.value(X) === B && $gameVariables.value(Y) === C && $gameVariables.value(Z) === A)||($gameVariables.value(X) === B && $gameVariables.value(Y) === A && $gameVariables.value(Z) === C)||($gameVariables.value(X) === C && $gameVariables.value(Y) === B && $gameVariables.value(Z) === A)||($gameVariables.value(X) === C && $gameVariables.value(Y) === A && $gameVariables.value(Z) === B );
The code looks a bit intimidating, but it should work given the correct numbers. Let me know if you have any problems with it.
EDIT:
@hernanvalles88 I took a look at the info you gave of the event. I think there was a misunderstanding about the conditional branches. Understandable, they are tricky little devils sometimes but when used to their fullest they are incredibly powerful. Same with variables and switches.
Basically what happened in your event:
the player selects an item
then you checked to see if the player HAS the item rather than if the item he chose was book A
hopefully I can explain this clearly...
The item select will put the item ID into the variable you chose, so to use a conditional branch to check if the item the player chose was a particular item you would do the following:
*assuming book a has the ID of 3 and you used variable 1
if variable 1 = 3
"the player chose the right item!"
else
"the player chose the wrong item..."
checking if the player HAS an item is seeing whether it's in their inventory or not.