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