G.setfenv
From GMod Wiki
| Function | |
| Syntax |
setfenv( function Affected Function : Integer Stack Level , Table Environment ) Where is this used? |
| Description: | |
| Sets what a function sees as the global environment, or to put it another way, what table the function searches when you call up a global variable. | |
| Returns: | function |
| Part of Library: | Global Functions |
| Realm: |
|
| BBCode Link: | [b][url=http://wiki.garrysmod.com/?title=G.setfenv]G.setfenv [img]http://wiki.garrysmod.com/favicon.ico[/img][/url][/b] |
Examples
Additional Notes
- You can use a positive integer instead of a function for the 1st argument, this represents the stack level of the function to be affected. 1 is the current function, 2 is the function calling the current function, and so on.