Hide All Events/Characters On Map

I am trying to find a way to hide all the events on the map through a script call.
I think I should be able to call it from this right?

Code:
Scene_Map.prototype.startEncounterEffect = function() {
    this._spriteset.hideCharacters();
    this._encounterEffectDuration = this.encounterEffectSpeed();
};
Kind of? That middle line of code is doing some of what you want, but it's hiding events and the player's party - just like it says, all characters.

If that's what you want, then when the player is on the map you can do SceneManager._scene._spriteset.hideCharacters()
I am trying to find a way to hide all the events on the map through a script call.
Yep as @ATT_Turan above mentioned above "SceneManager._scene._spriteset.hideCharacters()" hides all characters including players, followers, vehicles, etc. not just the events.

If you want only to hide only the events could be done with something like this:
JavaScript:
SceneManager._scene._spriteset._characterSprites.forEach(function(sprite){if (!sprite.isTile() && sprite._character._eventId){sprite.hide();}})
Then to reshow them would be:
JavaScript:
SceneManager._scene._spriteset._characterSprites.forEach(function(sprite){if (!sprite.isTile() && sprite._character._eventId){sprite.show();}})
The Evented Workaround is maybe not a good solution for this in particular, but i mention it anyways XD, just in case someone else might need something similiar without Scripting. But Scripting it is interesting. Thanks for the answers so far.

In every Event create a new empty Eventpage (Highest Page Number), make Page condition a Global Switch, for example Switch1 for all Events.
Check also the Box for Through On.

If you turn Switch 1 On or Off all those Events will disappear or reappear.
Because the Active Eventpage changes to an empty one.
Thanks everyone for the responses. It worked perfectly. I've been having a harder and harder time finding answers online by using Google lately. I spent 3 hours yesterday trying every search combination on Google and it failed to bring up anything relevant. I then used a different search engine and found multiple people who asked and had this question above answered. So frustrating.

*Edit I found a work around by using a picture to block the screen. But when I fadein/out or tint screen the sprites are shown again. And I have to do the script call again The downside is that you can see the sprites flash as they are shown and then re-hidden. I used a large black image to just hide this transition, but I was wondering if there was an easier method?

Original thread: https://forums.rpgmakerweb.com/threads/hide-all-events-characters-on-map.151138/