Check position between Player & Event? HELP

Hi guys, please HELP. I want to check position between Player & an Event to see if Player is standing next to it or not
(Don't want to do this with command events, it's a lot of nest Conditional Branches)

I found this plugin but i don't know how to use it?
https://forums.rpgmakerweb.com/index.php?threads/player-vs-event-position-plugin.85046/#post-789983

I put it into command script like this but it won't work:
if (this.playerVsThisEventDistance(2))
{$gameVariables.setValue (222, 2);}

And i tried to put the script into Conditional Branch command but it won't work too
index.php


Please HElp =.+
In a conditional branch in the script section, try this:

Code:
Math.abs($gamePlayer.x - $gameMap.event(2).x) + Math.abs($gamePlayer.y - $gameMap.event(2).y) === 1

That will return true if the player and event are one tile away horizontally or vertically, and false otherwise. If the player and event are one tile away diagonally, it will return false, as the total distance will be 2 tiles (one up/down and one left/right).
Oh great, thank you very much

Original thread: https://forums.rpgmakerweb.com/threads/check-position-between-player-event-help.87906/