Praecedo
|
  |
| Joined: 27 Dec 2011 |
| Total Posts: 308 |
|
|
| 09 Jun 2013 01:06 AM |
Can you use _G variables in local scripts?
Probably a stupid question (guessing the answer is no), but I just wanted to check. |
|
|
| Report Abuse |
|
|
Desperian
|
  |
| Joined: 07 Feb 2012 |
| Total Posts: 3371 |
|
|
| 09 Jun 2013 01:15 AM |
| Yes, you can use global variables in a local script however you won't be able to access global variables made in server side scripts. |
|
|
| Report Abuse |
|
|
Praecedo
|
  |
| Joined: 27 Dec 2011 |
| Total Posts: 308 |
|
|
| 09 Jun 2013 01:33 AM |
| So if I create the variable in a script in the Workspace then tried to access it in a LocalScript in the PlayerGui it wouldn't work? |
|
|
| Report Abuse |
|
|
|
| 09 Jun 2013 01:41 AM |
| Nope. Scripts in Workspace run on the server - roblox's game that handles everything. LocalScripts run on your computer, so they can access your mouse/keyboard and make everything seemless. There isn't a good way to send variables back and forth other then StringValues and stuff, and in most cases you don't need to either. |
|
|
| Report Abuse |
|
|
Praecedo
|
  |
| Joined: 27 Dec 2011 |
| Total Posts: 308 |
|
|
| 09 Jun 2013 01:56 AM |
| Alright, thanks. I guess I'll figure out another way to do what I'm trying to do. |
|
|
| Report Abuse |
|
|