Help with a script to detect distance between player and an actor

i have no clue how to fix it
oh and btw its in a conditional branch
Math.abs(Math.abs($Game_Player.x - $gameMap.event(this.eventId()).x) - Math.abs($Game_Player.y - $gameMap.event(this.eventId()).y)) <= 1;
JavaScript:
Math.hypot($gameMap.deltaX($gamePlayer.x, this.character(0).x), $gameMap.deltaY($gamePlayer.y, this.character(0).y)) <= 1
This checks for the distance between current event that is running the code and the player. In this case, the distance is equal to or less than 1 tile. Change as needed.

(I'm assuming you are referring to the current event and player instead of actor since your code reflects that)

Original thread: https://forums.rpgmakerweb.com/threads/help-with-a-script-to-detect-distance-between-player-and-an-actor.165958/