Scripting HelpersARCHIVE
A little piece of Roblox history. Preserved for everyone, one question at a time.Read about the archive →
COMMUNITY QUESTION

Is there a way to detect, if a server is ran by "Play Solo" or "Test Server" by a Script?

Can't define the question any further.

1 answer

In terms of running in studio you can use this InStudioMode

for play solo you will need to look at the network replicators as playing solo does not create these.

for the test server look for replicators as they are needed.

Hope this helps.

Edit:-

local isStudio = UserSettings().GameSettings:InStudioMode() -- this is how you get the info

-- test for studio
if UserSettings().GameSettings:InStudioMode() then
	print('you are in studio')
else
	print('you are not in studio')
end

local NetworkServer = game:GetService('NetworkServer') -- NetworkServer from server side, NetworkClient  for client side.
if NetworkServer then -- nil if no service found
	print('running server')
else
	print('not running server')
end

This only shows the basics of how it would work.

2 comments

0

Could you please give and example script? Thanks!

0

Example script added.

This discussion is preserved as it was. New answers, comments, and votes are closed.