|
| 31 Jan 2016 10:57 PM |
--modulescript: module = {} pie = nil return module
--script: module.pie = 4
--print(module.pie) > nil |
|
|
| Report Abuse |
|
|
cntkillme
|
  |
| Joined: 07 Apr 2008 |
| Total Posts: 44956 |
|
|
| 31 Jan 2016 10:59 PM |
you need to require the modulescript
-- ModuleScript: local module = {}; module.pie = nil; -- not needed return module;
-- Script: local module = require(ModuleScript); module.pie = 4; print(module.pie); |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2016 11:07 PM |
it is required, but still returns nil
might just insert an IntValue inside the modulescript |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2016 11:20 PM |
| I just tested and it worked fine for me, is this your actually script or an example of what you are actually doing? |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2016 11:22 PM |
I am printing from a localscript, and the modulescript is inside replicated storage. The serverscript sets the variable to 4 in the modulescript depending on game time, but the localscript still prints out nil |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2016 11:37 PM |
ModuleScripts cache which is what makes this possible
But they cache separately on the server and on each client. |
|
|
| Report Abuse |
|
|
|
| 31 Jan 2016 11:49 PM |
| I see. i guess i'll just use an intvalue |
|
|
| Report Abuse |
|
|
|
| 01 Feb 2016 01:27 AM |
--modulescript: module = {} module.pie = nil return module
--script: module.pie = 4
|
|
|
| Report Abuse |
|
|
|
| 01 Feb 2016 01:28 AM |
| That wouldn't work for his purposes, we already solved the problem. |
|
|
| Report Abuse |
|
|