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 8 years ago

Can't define the question any further.

1 answer

Log in to vote
2
Answered by 8 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:-

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.

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

Answer this question