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

How to let a script detect game mode?

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

✓ Accepted answer

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

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