Galv's Event Spawner MZ

Hello! how i unspawn an event?
i tried the script call Galv.SPAWN.unspawn(4); but it don't work (4 is the spawned event's id)
it says obj.eventId is not a function
The script call was meant to be run in the event you want to unspawn in and takes an object, not a number:
JavaScript:
Galv.SPAWN.unspawn(this);

The 'this' refers to the event that the code is run in. I recommend doing that as it is more difficult to get the event Id of the spawned event (it is not the same as the event Id is has on the spawn map). If you do know it, you can replace 'this' with something like:

JavaScript:
let event = $gameMap.event(4);
Galv.SPAWN.unspawn(event);

(I hope that syntax is correct, I didn't test it).
i did make a script call with this
let event = $gameMap.event(4);
Galv.SPAWN.unspawn(event);

but it doesn't do anything.. the spawned event is still there..
Are you certain that is the spawn event's id? It is not the same id as from the spawn map.
ohhh now i see what you meant..
so let's say i have 100 events on the map where the spawned event will be,
the erased number should be 101..?
If I recall it's getting the index of the event, which starts at 0, so if you have 100 events, it might spawn the next one at 100.

I would try to erase the event from the event itself using the script call, but doing that depends on how you're utilizing it.

Original thread: https://forums.rpgmakerweb.com/threads/galvs-event-spawner-mz.127944/