AnimeWiki
|
  |
| Joined: 26 Oct 2014 |
| Total Posts: 460 |
|
|
| 03 Mar 2015 10:19 AM |
| like if i have variables and tables inside module how can i share with main script ? |
|
|
| Report Abuse |
|
|
| |
|
AnimeWiki
|
  |
| Joined: 26 Oct 2014 |
| Total Posts: 460 |
|
|
| 03 Mar 2015 10:23 AM |
| thank you but thats not what i mean if u are variable inside module how can u talk with main script. |
|
|
| Report Abuse |
|
|
|
| 03 Mar 2015 10:24 AM |
| http://wiki.roblox.com/index.php?title=Module_scripts |
|
|
| Report Abuse |
|
|
gskw
|
  |
| Joined: 05 Jan 2013 |
| Total Posts: 1364 |
|
|
| 03 Mar 2015 10:25 AM |
On the last line of the Module, return a table, like so: return {my_variable = my_variable};
So now, when you require() the Module: local module = require(workspace.ModuleScript);
You can use your function in the script: print(module.my_variable);
This is a signature. Recommended username: HeavenlyGskw |
|
|
| Report Abuse |
|
|
AnimeWiki
|
  |
| Joined: 26 Oct 2014 |
| Total Posts: 460 |
|
| |
|