Add new property to an event via scriptcall?

Is it be possible to add a new property(like those that they already have, such as ID, name, notes,etc) to events, via script call?

What I want to achieve here is a system where I'll spawn an object with yanfly event spawner, then "make it hold a number". This number would be the ID of the player that spawned it, and later on, when that event gets destroyed, damaging another player, I would be able to keep track of who spawned it, to give the one who did some gold in case it killed someone.
(It is a multiplayer project)
Code:
$gameMap.event(this.eventId()).property = value;
Hope this works.
I just dont know if that will be saved when you hit save because event data is not saved into the save file and are reloaded from database when needed (i.e. version difference between save and current game).

Afaik this is also why "Self Switches" are not actually properties of events but rather a global array which takes the [mapId,eventId,switchId] as its key.
It's an online RPG, so I think that's not going to be that much of an issue.
Depends on how he does the whole multiplayer thing then.. If he keeps the data of everything, then all is good I guess.
Depends on how he does the whole multiplayer thing then.. If he keeps the data of everything, then all is good I guess.
It is battle royal style(with RPG elements), so I don't need to keep this data inside save, as no save is done(unless the one hosting the server wants and modifies the current server.js file, anyway...)

Code:
$gameMap.event(this.eventId()).property = value;
Hope this works.
This works perfectly! I didn't even remember that events are basically javascript objects, within a object representing the map. Thanks for the help.
It is battle royal style(with RPG elements), so I don't need to keep this data inside save, as no save is done(unless the one hosting the server wants and modifies the current server.js file, anyway...)

I see, then yeah everything is fine

This thread is being closed, due to being solved. If for some reason you would like this thread re-opened, please report this post and leave a message why. Thank you.

Original thread: https://forums.rpgmakerweb.com/threads/add-new-property-to-an-event-via-scriptcall.106495/