WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 14 Feb 2017 09:48 AM |
Hello!
This might be a stupid question but i can't fint the answer. Can you please tell me how to make variables that can be accesible from other scripts.
/wilhelm |
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
| |
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 14 Feb 2017 10:01 AM |
| like this? # = 3 _G.Variable = ### |
|
|
| Report Abuse |
|
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
| |
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
|
| 14 Feb 2017 10:05 AM |
_G.VariableName = "This is an example"
print(_G.VariableName) > This is an example
_G.example = function(text) print(text) end
_G.example"Hello world" > Hello world
~ Josh |
|
|
| Report Abuse |
|
|
|
| 14 Feb 2017 10:11 AM |
Do you know what tables are?
_G is literally just a table, which is accessible from all scripts. Keep in mind that this will not work between localscripts and normal scripts, or at least it won't if you have filtering enabled.
wiki.roblox.com/index.php?title=Global_namespace/Basic_functions#G
|
|
|
| Report Abuse |
|
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
| |
|
WilhelmP
|
  |
| Joined: 27 Aug 2014 |
| Total Posts: 28 |
|
|
| 15 Feb 2017 09:34 AM |
does iw work between diffrent locanscripts?
|
|
|
| Report Abuse |
|
|
JoshRBX
|
  |
| Joined: 19 May 2012 |
| Total Posts: 8778 |
|
| |
|