MV [YEP_EventSpawner]Check if coordinate is valid for spawning.

In my current game, I've been working on a system of spawning and placing furniture. The issue is that I don't know how to check if the event failed to spawn. I'd like to check if the given coordinates are valid beforehand, and if not, avoid consuming the resources and inform the player what went wrong.


Edit: Found a solution.
1700580122980.png


Edit 2: If you use variables for the coordinates, you need to add .length or it won't work.
$gameMap.eventsXy($gameVariables.value(3), $gameVariables.value(4)).length > 0
For example like this:

Code:
If: Script: ...
    Message: There's already an event there.
    Switch: Success OFF
Else
    Script: Yanfly...
    Switch: Success ON
End

Original thread: https://forums.rpgmakerweb.com/threads/yep_eventspawner-check-if-coordinate-is-valid-for-spawning.163136/