MV if party member in group, code

Hi all, I need your help again, you see, I have a code that removes the actors from the group once they die, this works fine in battles, but the problem is that when they die by a trap on the map, since all the members of the group are deleted, the game does not know which actors are dead and can not run the game over leaving the game bugeted like this:
View attachment 291058

I need a conditional code that asks if there are members in the group, and if there are none, to run the game over scene. I clarify that the option that comes by default in RPG maker does not work, because it asks specifically that id of actor is or is not in the group, and this does not serve me as I use a plug in that duplicates the actors and adds another id, so ideally it would ask if there are members by number, something like this for example:
View attachment 291059

I hope you can help me, thank you very much for your attention, you have helped me several times before and I appreciate it
I already solved the problem with this code:
1704646817648.png

It would be great if it didn't take so long to approve the publications

I've moved this thread to Javascript/Plugin Support (from Plugin Releases). Thank you.

You originally posted in Plugin Releases, which is for sharing plugins you have made. Threads there have to be manually approved, hence the wait.

Good to hear you found a solution, though! Happy RPG Making~ 👋

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/if-party-member-in-group-code.164574/