| |
|
| |
|
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
|
  |
| 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 |
|
|
|
| 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
|
  |
| 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 |
|
|
|
| 04 Mar 2017 10:36 AM |
And that's not always true. That's why I added "Only among different clients."
|
|
|
| Report Abuse |
|
|
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 |
|
|
|
| 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 |
|
|
|
| 04 Mar 2017 10:44 AM |
Are they a bit similar to bindable functions?
print("hello fourm") |
|
|
| Report Abuse |
|
|
AxonMega
|
  |
| Joined: 29 Aug 2014 |
| Total Posts: 2403 |
|
|
| 04 Mar 2017 10:44 AM |
| How is that different from what I said? |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 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 |
|
|
|
| 04 Mar 2017 10:48 AM |
dont git trigg
print("hello fourm") |
|
|
| Report Abuse |
|
|
|
| 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 |
|
|
|
| 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 |
|
|