blueymaddog Administrator


Posts: 1108 Join date: 2010-12-09 Age: 13
 | Subject: Re: Tutorial ~ getfenv()/setfenv() March 20th 2011, 3:10 am | |
| would this be a _G fixer:
script1:
getfenv(print).bai = "lol"
script2: print(bai) _________________ blueymaddog Administrator • Moderator • Expert Scripter PM: blueymaddog<+1 post. ujelly?> |
|
m27frogy Moderator


Posts: 159 Join date: 2011-06-23
 | Subject: Re: Tutorial ~ getfenv()/setfenv() June 30th 2011, 8:53 am | |
| Great job NotAPotato! | Quote: | Heres an observation i made earlier about this for people who are knew to this ... To always remember what Setfenv() and Getfenv() are you remember it like this.
Set in Setfenv() is Set, f in Setfenv() is function, env in Setfenv() is Environment, and put it all together and it means Setfenv() Set's the function's environment,
Get in Getfenv() is Get, f in Getfenv is function, env in Getfenv() is environment, put it all together, and it means Getfenv() Get's a function's environment.
Nice little observation i made earlier today lol, but this is a good way to remember what Setfenv() and Getfenv() does. | Not a bad way of looking at it ninga! |
|
Supernapalm Expert Scripter

Posts: 380 Join date: 2011-01-17
 | Subject: Re: Tutorial ~ getfenv()/setfenv() June 30th 2011, 2:20 pm | |
| erm. thats why the creator of the lua gave this function its name
setfenv: set function environment getfenv: get function environment |
|
m27frogy Moderator


Posts: 159 Join date: 2011-06-23
 | Subject: Re: Tutorial ~ getfenv()/setfenv() June 30th 2011, 2:46 pm | |
| I knew that Supernapalm. That still doesn't effect my actual statement, "way of looking at it". |
|
Supernapalm Expert Scripter

Posts: 380 Join date: 2011-01-17
 | Subject: Re: Tutorial ~ getfenv()/setfenv() June 30th 2011, 2:51 pm | |
| actaully, its pretty much the only way of looking at it, cuz the lua creator said so |
|
m27frogy Moderator


Posts: 159 Join date: 2011-06-23
 | Subject: Re: Tutorial ~ getfenv()/setfenv() June 30th 2011, 3:20 pm | |
| Yes, that way of looking at it is still interesting. |
|
blueymaddog Administrator


Posts: 1108 Join date: 2010-12-09 Age: 13
 | Subject: Re: Tutorial ~ getfenv()/setfenv() February 11th 2012, 3:54 am | |
| lol it's the way I looped at it before i saw this tutorial. I think it's the only way of seeing it. :P _________________ blueymaddog Administrator • Moderator • Expert Scripter PM: blueymaddog<+1 post. ujelly?> |
|