Exit a minigame screen with script call

Have a nice day.

I'm using this minigame for a scene in my main game. The script pops up a menu where the actor plays Blackjack with an NPC to get a key. The actor needs to win 5 times total to have the key and that's fine but the problem is, the Blackjack menu doesn't pop off once the actor wins the five times and I'm seeking for it.

I need to do this so far to get the key: click on the Retire button and then walk to the npc, start a conversation and he automatically gives it to me.

What I want to do is that once I win the fifth time, the Blackjack game screen pops off and the message for the key shows up right after it.

I'm noob in scripting and barely know how to read the code lines but any explanation for a solution would be infinitely appreciated :3 I'll attach my event page as well.
Looks like it processes a return scene when retire is selected.
You could probably just do a SceneManager.scene.return_scene to get the scene to call a return scene command
Just take a look at this demo I've been working on for a while.

oh I guess that's what I'm looking for. Thanks. I'll try and then come back.
Looks like it processes a return scene when retire is selected.
You could probably just do a SceneManager.scene.return_scene to get the scene to call a return scene command

Just take a look at this demo I've been working on for a while.

Ok ok. Lemme see
Looks like it processes a return scene when retire is selected.
You could probably just do a SceneManager.scene.return_scene to get the scene to call a return scene command
This command doesn't get me out of the mini game but the game test! It sends me to the menu where I select the Continue/ Start options.

Original thread: https://forums.rpgmakerweb.com/threads/exit-a-minigame-screen-with-script-call.154162/