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 » Scripters
Home Search
 

Re: Does getfenv() allow you to name variables as strings?

Previous Thread :: Next Thread 
Tenal is not online. 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
trappingnoobs is not online. trappingnoobs
Joined: 05 Oct 2008
Total Posts: 19100
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 is not online. 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 is not online. 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
TheCapacitor is not online. TheCapacitor
Joined: 19 Jan 2011
Total Posts: 7045
29 Sep 2012 04:28 PM
getfenv(0)["Yes"] = "Ohai"
print(Yes) // > Ohai
Report Abuse
LPGhatguy is not online. LPGhatguy
Forum Moderator
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 is not online. Anaminus
Top 100 Poster
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 is not online. 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
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • 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