Trigger Common Event by Clicking on Player

I want to trigger a common event when you click on the player character in RMMV.

Any thoughts on the most efficient way to do this?
Toss this into the conditional branch to check if the player character is being clicked on. I'm assuming you're using a 48x48 tile size.
Code:
Math.floor(TouchInput._x/48) === Math.floor($gamePlayer.screenX()/48) && Math.floor(TouchInput._y/48) === Math.floor($gamePlayer.screenY()/48)

Remember to do a script call to clear the clicked data after the event is over. Otherwise, your common event is going to loop.
Code:
TouchInput.clear()

BTW, nice resources you have there! I'm downloading them XD
Awesome! Thanks so much. That script works perfectly. Unfortunately, I have MouseSystemEx installed and it's causing it to activate on hover, so I'll have to find a workaround for that little hiccup. I'm going to have to do some tinkering to disable MouseSystemEx when I'm not in the menu. Thanks again!
Does it work if you add
Code:
Input.isPressed('ok')
to the condition? Hopefully this will place an extra check if the left mouse button is clicked.
Not quite, but a separate condition check for TouchInput.isPressed() solved both the compatibility problem and a different problem (where it would trigger after moving to a clicked location). Thanks a ton for your help!

Original thread: https://forums.rpgmakerweb.com/threads/trigger-common-event-by-clicking-on-player.85283/