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: What are module scripts?

Previous Thread :: Next Thread 
RocketScientist50 is not online. RocketScientist50
Joined: 01 Nov 2015
Total Posts: 239
04 Mar 2017 09:57 AM
Help.


print("hello fourm")
Report Abuse
LightFantom is online. LightFantom
Joined: 23 Sep 2014
Total Posts: 7830
04 Mar 2017 10:06 AM
Wiki?


Report Abuse
RobuxLife is not online. RobuxLife
Joined: 19 Sep 2012
Total Posts: 13336
04 Mar 2017 10:07 AM
If you don't understand the wiki, think of them like this:

Lets say you have a mini game place. You have all of these functions, like giving coins, teleport the players, etc. You don't want a long messy script, so you use module scripts. Basically, you put all of your functions into the module script and use them whenever you need to.


Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
04 Mar 2017 10:09 AM
They are used to either organize your code if its really long and messy or to let you execute the same code in different scripts.
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
04 Mar 2017 10:29 AM
"execute the same code in different scripts"

Only among different clients. Once the ModuleScript is required on the server/a client once, it won't run anymore. It'll return the same value every time after that.


Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
04 Mar 2017 10:36 AM
No I mean you can execute the same function in different scripts.
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
04 Mar 2017 10:36 AM
And that's not always true. That's why I added "Only among different clients."


Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
04 Mar 2017 10:41 AM
Yes it is. You can define a function in a module script and execute it multiple times in different scripts run by the same computer.
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
04 Mar 2017 10:44 AM
That's different. The function that is returned by the module is the return value, and won't ever be changed again. The ModuleScript stops being executed after it's required on the server/each client once.

Of course you can execute what the ModuleScript returns more than once, but it will hold the same return value.


Report Abuse
RocketScientist50 is not online. RocketScientist50
Joined: 01 Nov 2015
Total Posts: 239
04 Mar 2017 10:44 AM
Are they a bit similar to bindable functions?


print("hello fourm")
Report Abuse
AxonMega is online. AxonMega
Joined: 29 Aug 2014
Total Posts: 2403
04 Mar 2017 10:44 AM
How is that different from what I said?
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
04 Mar 2017 10:45 AM
No, they aren't similar to bindables... didn't you ask this a few days ago and get the same answer from me?


Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
04 Mar 2017 10:46 AM
"How is that different from what I said?"

Because the way you worded your first response could have been misleading to OP. They could be trying to execute a ModuleScript among different scripts on the same peer and be wondering why it's returning the wrong thing.


Report Abuse
RocketScientist50 is not online. RocketScientist50
Joined: 01 Nov 2015
Total Posts: 239
04 Mar 2017 10:48 AM
I did.I just think that they are a bit similar to bindables as you are a able to access them in other scripts.


print("hello fourm")
Report Abuse
RocketScientist50 is not online. RocketScientist50
Joined: 01 Nov 2015
Total Posts: 239
04 Mar 2017 10:48 AM
dont git trigg


print("hello fourm")
Report Abuse
Unsubtleties is not online. Unsubtleties
Joined: 28 Nov 2016
Total Posts: 9203
04 Mar 2017 10:49 AM
They're entirely different though. ModuleScripts allow you to reuse a value among different scripts while Bindables are for communication among different scripts


Report Abuse
RocketScientist50 is not online. RocketScientist50
Joined: 01 Nov 2015
Total Posts: 239
04 Mar 2017 10:52 AM
Well, I might not have to worry about modules because I will (most likely) never use them and I will just do the hard way instead.




print("hello fourm")
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