gogo6104
|
  |
| Joined: 10 Feb 2010 |
| Total Posts: 326 |
|
|
| 09 Nov 2016 04:07 PM |
I have a Module Script, but everything I put in it, like things that rely on game.PlayerAdded, etc, won't run. Module Scripts don't run all the time? If I have a script INSIDE of the Module Script, the reg script won't run either, how can I make it run?
|
|
|
| Report Abuse |
|
|
|
| 09 Nov 2016 04:28 PM |
| I'm not sure, but I think script,module,and local all have differences. Like for local scripts you would need to put LocalPlayer. |
|
|
| Report Abuse |
|
|
SurKipper
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 435 |
|
|
| 09 Nov 2016 05:06 PM |
Module scripts don't run when the game starts, they are used for defining global functions that can be accessed from other scripts.
You can read more on them at the wiki |
|
|
| Report Abuse |
|
|
chimmihc
|
  |
| Joined: 01 Sep 2014 |
| Total Posts: 17143 |
|
|
| 09 Nov 2016 05:14 PM |
"Module scripts don't run when the game starts, they are used for defining global functions that can be accessed from other scripts."
Wrong.
|
|
|
| Report Abuse |
|
|
SurKipper
|
  |
| Joined: 25 Dec 2011 |
| Total Posts: 435 |
|
|
| 09 Nov 2016 05:16 PM |
| From the Wiki "Unlike other scripts, a module does not execute when a game starts." "When writing code for a large project, you may find yourself defining the same function in several different places. Using module scripts, you can define a function in one place to be used in ### ###### of scripts. This makes maintaining and updating code much easier, as you only have to make changes in one place (as opposed to searching for all the scripts where you use the function)" |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2016 05:26 PM |
It doesnt execute upon game start or whenever it is not disabled But what it does do is execute its code onto whatever host requires it (each client and each server) and only once, after that it just uses the same return values each time its required on the same host |
|
|
| Report Abuse |
|
|
|
| 09 Nov 2016 06:22 PM |
You need to require a module script for them to work.
R$19,314 -- I wonder? |
|
|
| Report Abuse |
|
|