|
| 21 Jun 2012 07:07 PM |
Can functions be stored in the _G table? If so: ------------------------------------------------------- Can they be carried across scripts? Can they be used across games? How do you create it? |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 07:09 PM |
Can functions be stored in the _G table? If so: ** YES ------------------------------------------------------- Can they be carried across scripts? ** YES (Only on the same client/server) Can they be used across games? ** NO How do you create it? ** BELOW
function _G.Test(msg) print(msg:upper()) end
Other script:
_G.test("Hello there")
Output: HELLO THERE |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 07:10 PM |
Another question: Can the script that creates them be delted, or does it have to stay?
|
|
|
| Report Abuse |
|
|
| |
|
|
| 21 Jun 2012 07:39 PM |
| As long as its attached to the table, it should stick without the script. |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 07:42 PM |
| Ok. Thanks. I might just save a backup to fix it if it breaks :D |
|
|
| Report Abuse |
|
|
|
| 21 Jun 2012 07:47 PM |
Since _G is a globally defined table (accessible from all scripts running on same server or client), it is not removed or changed when a script is removed.
This means all values in _G remain in _G until CHANGED via script. |
|
|
| Report Abuse |
|
|