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