Removing player deselects scripts in Play Solo

Repro:

Insert a localscript into a screengui inside of playergui
Open it
Press play solo
Remove the player somehow. What I do it right click -> remove

Now the tab with the script is gone.

I’m thinking studio switches the tab to the instance that is stored in the player, and when it’s deleted it removes the tab, and because the tab is closed it doesn’t get switched back when the game closes

Edit: I cant seem to repro this, the above text was just an assumption based on what you described, the tab stays open for me

Which shouldn’t really make sense because the script is inside of StarterGui.ScreenGui, not PlayerGui.ScreenGui, right?

1 Like

I don’t see any issues. If you create something at runtime and put it in a player’s PlayerGui, it will disappear when you stop the simulation. If you want it to last, you should first stop the simulation, add it to StarterGui, and then click the play solo button.

It’s not runtime.

You insert it during studio ‘stop’ state. When you open it in ‘stop’ state and then focus on the game preview window again and press play then stop the tab is now gone.

How do you have a PlayerGui if the simulation is stopped? Are you in team create?

No team create.

I put the script in startergui when the game is in stop state. I open it in script editor and it’s tab opens. Once I go back to game preview tab and see the 3d workspace I press play then stop. Now the tab is closed for the script.

If you follow these steps exactly does it occur? If not, please provide more specific steps because I can’t reproduce the issue and I’ve tried exactly what you said.

  • Open a new place in Studio
  • Insert a Script into StarterGui
  • Open the script by double-clicking on it in the explorer
  • Click on the Place1 tab
  • Press the play solo button
  • Press the stop button

Expected Result
The tab with the script remains open

Actual Result
The tab closes

That’s correct.

It shouldn’t close.

What is your operating system? Have you tried temporarily disabling all your plugins to see if it is caused by any of them?