Tenal
|
  |
| Joined: 15 May 2011 |
| Total Posts: 18684 |
|
|
| 29 Sep 2012 03:47 PM |
And how would it be done? I remember doing this but I completely forgot how it was done. |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 03:48 PM |
¬______¬
and now we know tenal's knowledge of lua is hard-coded and non-dynamic or initiative based |
|
|
| Report Abuse |
|
|
Luc599345
|
  |
| Joined: 25 Jul 2008 |
| Total Posts: 1169 |
|
|
| 29 Sep 2012 04:10 PM |
for i,v in pairs(getfenv(0)) do print(i) end
ta daaaaaaaaa |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 29 Sep 2012 04:15 PM |
Now I know why Tenal posted this here...
http://www.roblox.com/Forum/ShowPost.aspx?PostID=79109879 |
|
|
| Report Abuse |
|
|
|
| 29 Sep 2012 04:28 PM |
getfenv(0)["Yes"] = "Ohai" print(Yes) // > Ohai
|
|
|
| Report Abuse |
|
|
LPGhatguy
|
  |
 |
| Joined: 27 Jun 2008 |
| Total Posts: 4725 |
|
|
| 29 Sep 2012 05:45 PM |
Remember that getfenv returns a table. Remember that Lua tables are by-reference-kinda.
Just add an index to the table getfenv returns and suddenly, it works. |
|
|
| Report Abuse |
|
|
Anaminus
|
  |
 |
| Joined: 29 Nov 2006 |
| Total Posts: 5945 |
|
|
| 29 Sep 2012 05:45 PM |
It's really the other way around. When you get or set a global variable, you're just accessing the environment table.
`variable = true` is similar to `getfenv().variable = true`
`print(variable)` is similar to `print(getfenv().variable)` |
|
|
| Report Abuse |
|
|
TheMyrco
|
  |
| Joined: 13 Aug 2011 |
| Total Posts: 15105 |
|
|
| 29 Sep 2012 09:05 PM |
I tought I'd share this.
http://www.roblox.com/Forum/ShowPost.aspx?PostID=79114352
Skip to blobby's post. |
|
|
| Report Abuse |
|
|