Currently there is no way to distinguish between a Local Server test and studio test mode. Having a way to distinguish between these two modes would be useful for testing games that have a different single-player experience to a multiplayer experience.
Having this function would remove the need to having to alter scripts manually everytime you want to test in a different environment as you could just build in support and not have to worry about it past that point.
Create a local plugin that checks if game.Name == "Server" then set an attribute on Workspace or something that your scripts can read. Plugins load instantly, so you don’t need to instantiate any of the plugin button stuff.
Helps in the meanwhile if this is a pain point during development.
In some cases this isn’t a solution (such as for testing cross server teleports). When teleporting players to a sub-place in your game you probably also want to send the expected player count so you can wait for everyone to connect, and currently the only way to replicate this behaviour in studio is to manually set the expected player count before you local test or to have an arbitrary wait that delays getting the player count (neither of which are ideal).
This isn’t relevant, this only distinguishes between studio and a live session not between studio solo play and local server. You can use RunService:IsStudio() to achieve the same thing you have here.