abaw7
|
  |
| Joined: 23 Oct 2009 |
| Total Posts: 745 |
|
|
| 24 Dec 2011 12:54 PM |
Is _G Locked in a way do i can't make a variable and access it in another script Ex:
Script 1 _G.1 = 123
Script 2 Print(_G.1)
Any help on this would be appreciated.
|
|
|
| Report Abuse |
|
|
|
| 24 Dec 2011 12:59 PM |
you have to do it like: Script 1: _G["1"] = 123
Script 2: print(_G["1"] )
>123
~I've been to nil and back. |
|
|
| Report Abuse |
|
|
abaw7
|
  |
| Joined: 23 Oct 2009 |
| Total Posts: 745 |
|
|
| 24 Dec 2011 01:00 PM |
| Ok thank you just trying to make sure I wasn't going to make a broken script before I even start. |
|
|
| Report Abuse |
|
|
abaw7
|
  |
| Joined: 23 Oct 2009 |
| Total Posts: 745 |
|
|
| 24 Dec 2011 01:14 PM |
| Now just checking I can make a table the same way as a variable using _G? |
|
|
| Report Abuse |
|
|
|
| 24 Dec 2011 01:16 PM |
_G can be put before any variable.
_G.t = {"hi"} _G.o = workspace.Part _G.s = "wkihgwfidasfh" _G.i = 45
bon |
|
|
| Report Abuse |
|
|
abaw7
|
  |
| Joined: 23 Oct 2009 |
| Total Posts: 745 |
|
| |
|
|
| 24 Dec 2011 01:19 PM |
seems to work
_G["table"] = {1,2,3,4,5} for i = 1,#_G["table"] do print(_G["table"][i]) end
~I've been to nil and back. |
|
|
| Report Abuse |
|
|