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

How to let a script detect game mode?

Asked by 8 years ago

I need a code that would detect if the player is in studio mode or game mode. Is this possible, if so how would I do it?

2 answers

Log in to vote
1
Answered by 8 years ago

I have not tested this, but I believe that you would try to see if something called Player1 is in Players. Since Player1 is who you test with, if Player1 would not be in Players, then this game is not being tested in studio and this game is therefore being run online.

It should sort of look like this:

if game.Players:FindFirstChild("Player1") then
    --Game is being tested in studio
else
    --Game is being run online
end
Ad
Log in to vote
-1
Answered by 8 years ago

I believe it is only possibal by plugin

Answer this question