Scripting Helpers is winding down operations and is now read-only. More info→
Ad
Log in to vote
1

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

Asked by 9 years ago

Can't define the question any further.

1 answer

Log in to vote
2
Answered by 9 years ago

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:-

01local isStudio = UserSettings().GameSettings:InStudioMode() -- this is how you get the info
02 
03-- test for studio
04if UserSettings().GameSettings:InStudioMode() then
05    print('you are in studio')
06else
07    print('you are not in studio')
08end
09 
10local NetworkServer = game:GetService('NetworkServer') -- NetworkServer from server side, NetworkClient  for client side.
11if NetworkServer then -- nil if no service found
12    print('running server')
13else
14    print('not running server')
15end

This only shows the basics of how it would work.

0
Could you please give and example script? Thanks! Dolphinous 36 — 9y
0
Example script added. User#5423 17 — 9y
Ad

Answer this question