Use items from inventory for puzzles?

I watched this video and followed everything line by line but it doesn't activate.


Example of what i'm trying to do.
Locked in room.
Gets key.
Key is added to inventory.
Approaches door.
Opens menu.
Selects key to use.
Because of the X,Y,& Direction input into common events, it recognizes the item and the event begins (You used the key to unlock the door)
If it's not in the right area it's supposed to say "You can't use this here" and it does that part fine so it seems like it's not picking up on the spot TO use it.

I really need to figure this out since it potentially changes how my game can be played.
This is what I input into common event contents:
$gamePlayer.scrolledX() == 5 && $gamePlayer.scrolledY() == 7 && $gamePlayer.direction() == 2 && $gameMap.mapId() == 6
Please show a screenshot of your event.
There are a lot of things that could have gone wrong, and a lot of them involve properties you didn't even mention in your description of your event.
That is quite normal and the reason why we prefer full screenshots: often the bug is in something that you don't realise as an important part. And in a screenshot we get everything, not only what you think is involved.
bandicam 2018-04-10 15-10-00-517.jpg
bandicam 2018-04-10 15-10-00-517.jpg
bandicam 2018-04-10 15-08-42-161.jpg
Please show a screenshot of your event.
There are a lot of things that could have gone wrong, and a lot of them involve properties you didn't even mention in your description of your event.
That is quite normal and the reason why we prefer full screenshots: often the bug is in something that you don't realise as an important part. And in a screenshot we get everything, not only what you think is involved.
And where and how do you call the common event?
That part is still missing from your screenshots.
I assume you are calling the common event from the item?

.scrolledX() and .scrolledY() are not the correct functions.
Use .x and .y instead like this:
Code:
$gamePlayer.x === 5 && $gamePlayer.y === 7 && $gamePlayer.direction() === 2 && $gameMap.mapId() === 6
I assume you are calling the common event from the item?

.scrolledX() and .scrolledY() are not the correct functions.
Use .x and .y instead like this:
Code:
$gamePlayer.x === 5 && $gamePlayer.y === 7 && $gamePlayer.direction() === 2 && $gameMap.mapId() === 6

That worked! Thanks a ton!

Original thread: https://forums.rpgmakerweb.com/threads/use-items-from-inventory-for-puzzles.93884/