generic image
Processing...
  • Games
  • Catalog
  • Develop
  • Robux
  • Search in Players
  • Search in Games
  • Search in Catalog
  • Search in Groups
  • Search in Library
  • Log In
  • Sign Up
  • Games
  • Catalog
  • Develop
  • Robux
   
ROBLOX Forum » Game Creation and Development » Scripters
Home Search
 

Re: Module Script

Previous Thread :: Next Thread 
gogo6104 is not online. 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
NukeLuckyLuke is not online. NukeLuckyLuke
Joined: 08 Apr 2016
Total Posts: 5767
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 is not online. 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 is not online. 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 is not online. 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
Wunder_Wulfe is online. Wunder_Wulfe
Joined: 13 Sep 2016
Total Posts: 8356
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
spyspace12 is online. spyspace12
Joined: 16 Nov 2012
Total Posts: 615
09 Nov 2016 06:22 PM
You need to require a module script for them to work.


R$19,314 -- I wonder?
Report Abuse
Previous Thread :: Next Thread 
Page 1 of 1
 
 
ROBLOX Forum » Game Creation and Development » Scripters
   
 
   
  • About Us
  • Jobs
  • Blog
  • Parents
  • Help
  • Terms
  • Privacy

©2017 Roblox Corporation. Roblox, the Roblox logo, Robux, Bloxy, and Powering Imagination are among our registered and unregistered trademarks in the U.S. and other countries.



Progress
Starting Roblox...
Connecting to Players...
R R

Roblox is now loading. Get ready to play!

R R

You're moments away from getting into the game!

Click here for help

Check Remember my choice and click Launch Application in the dialog box above to join games faster in the future!

Gameplay sponsored by:
Loading 0% - Starting game...
Get more with Builders Club! Join Builders Club
Choose Your Avatar
I have an account
generic image