generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripting Helpers
Home Search
 

Re: Which mode is the script running under?

Previous Thread :: Next Thread 
AxeOfMen is not online. AxeOfMen
Joined: 14 Dec 2011
Total Posts: 196
07 Jan 2012 06:28 PM
Is there a variable I can query to determine whether the script is executing in Play mode vs. Build/Edit mode?
Report Abuse
UFAIL2 is not online. UFAIL2
Joined: 14 Aug 2010
Total Posts: 6905
07 Jan 2012 06:30 PM
No variable that I know of. You could check for the 'Network Connection', or whatever it's called that appears when online.
Report Abuse
Chronok is not online. Chronok
Joined: 29 Dec 2011
Total Posts: 402
07 Jan 2012 06:35 PM
Hmmm... I believe in Play Solo there is a service that normally isn't visible called 'NetworkServer'. Try this:

    if game.NetworkServer then
        print("This script is running in Play Solo.")
    else
        print("This script is not running in Play Solo.")
    end

{ ["Chronok"] = "Intermediate scripter/programmer." }
Report Abuse
AxeOfMen is not online. AxeOfMen
Joined: 14 Dec 2011
Total Posts: 196
07 Jan 2012 07:06 PM
Thanks for the ideas. This is what ended up working:

if game:FindFirstChild("NetworkServer") then
--script is executing in play mode
else
--script is executing in edit/build mode
end


Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripting Helpers
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image