MV Looking for a specific script

I found this script once before but then I didn't save it and now I can't find it again. Was hoping someone knew how to recreate it or had the link to the original script.

Basically this script went into the events custom move route. And it checked if the player was within distance and if the player was within distance then it would execute a common event. It was a very short script but I'm still learning all of this.

I've moved this thread to Plugin Requests. Thank you.

Moved to: Plugin Requests
Maybe I'm not understanding terminology here, but I've only asked for 1 line of JavaScript code. Is that considered a "plugin"? If so I'm sorry for posting in the incorrect area.
If I'm understanding you correctly, you shouldn't need a plugin for it. I think you want:
Code:
if ($gameMap.distance($gamePlayer.x, $gamePlayer.y, $gameMap.event(event_id).x, $gameMap.event(event_id).y)<=your_distance)
    $gameTemp.reserveCommonEvent(common_event_id);
where event_id is the ID of the event that's moving, your_distance is how close you want it to have to be to the player, and common_event_id is the ID of the common event you want to call.
hiddeone recently released a tutorial here showcasing this exactly.
If I'm understanding you correctly, you shouldn't need a plugin for it. I think you want:
Code:
if ($gameMap.distance($gamePlayer.x, $gamePlayer.y, $gameMap.event(event_id).x, $gameMap.event(event_id).y)<=your_distance)
    $gameTemp.reserveCommonEvent(common_event_id);
where event_id is the ID of the event that's moving, your_distance is how close you want it to have to be to the player, and common_event_id is the ID of the common event you want to call.

This looks correct based on memory of the script. Thank you so much. I'll play test it later to see if it does what I intended it to. Although with my limited knowledge of scripting I feel like since it'll be in the move route I can just have it call this.event.x and this.event.y instead of specifying which ID it is. It would also make it easier to copy and paste if I needed more of them later on.

hiddeone recently released a tutorial here showcasing this exactly.

Omg this is wonderful! And it came with bonuses I didn't think I would ever need but now want to use!
I feel like since it'll be in the move route I can just have it call this.event.x and this.event.y instead of specifying which ID it is.
Perhaps! You can try it. I'm always leery of using this because it might end up referring to, like, the part of the game interpreter that's executing the move functions, or something, it's not necessarily a member function of the event itself. It takes me less time to just type the game variables out than it does to look it up in the code and figure out if it would work 😉

Original thread: https://forums.rpgmakerweb.com/threads/looking-for-a-specific-script.137949/