|
^ and if you prefer one over another in a specific situation, please specify.
I prefer ModuleScripts because I don't like having to type _. |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
I prefer ModuleScripts because _G just seems messy to me. |
|
|
yes, also _G can't be used in local scripts |
|
bohdan77Join Date: 2008-08-10 Post Count: 7944 |
ChatPersonDudeSomethingIDK
_G can be used with localscripts, just it's a different environment than Scripts. |
|
cntkillmeJoin Date: 2008-04-07 Post Count: 49450 |
I don't use either, I never really find myself needing to (unless library) |
|
|
I discovered ModuleScripts in December, and I fell in love with it. It is so much better than _G, since it doesn't pollute _G. Although there isn't much use for _G otherwise..... |
|
|
I use both _G and ModuleScripts. I use the ModuleScripts to organize code + load it in a specific order.
~LuaWeaver; Programmer, gamer, developer. |
|
bl0wmeupJoin Date: 2009-11-27 Post Count: 14388 |
I use both because when you can script as amazing as me it's just natural to do both |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
Dat 'Live As A Happy Family In Robloxia And Get Rich' and Kohl's admin... |
|
|
I like module b ecause you can easily track it down rather than having to find the source of where the global was created ehen I want to change it. Also modules can hold many functions. |
|
|
Actually, I have on my primary account already created a framework based on ModuleScripts. It also sandboxes them so an error in one can't propagate up the call stack and crash the main code :). I like it so far. I'm even considering doing remote loading of such modules off the Roblox website, so I can dynamically load any modules I don't have in the place. That WOULD save space, and make pushing updates easier. |
|
|
:/ Neither one is compatible with local. |
|
AlyteJoin Date: 2011-10-24 Post Count: 10090 |
I Prefer ModuleScript's Cause they Make U Game Faster xD |
|
|
I use both, because I use _G wrong.
Deal with it. |
|
|
*ModuleScripts wrong, not _G wrong. |
|
OysiJoin Date: 2009-07-06 Post Count: 9058 |
What are you guys on about? They are two completely different things. You don't use one or the other. Also, what are you talking about neither of them working on the client? That's completely incorrect. |
|
TenalJoin Date: 2011-05-15 Post Count: 18684 |
fedora boy above :^o |
|
celestalaJoin Date: 2013-05-22 Post Count: 7061 |
That's what I was thinking, Oysi.
While they may be used for similar tasks,
they're completely different.
As for this crap about them not being able to work on the client,
anyone who believes that either:
A. Never used them before.
or
B. Is an idiot. |
|
MettaurSpJoin Date: 2010-03-20 Post Count: 3179 |
If you are one who thinks they don't work on the client, use RemoteFunctions to replicate values to clients. _G and results for ModuleScripts do not replicate. |
|
SasayakiJoin Date: 2007-06-29 Post Count: 33868 |
I might be completely missing something with this statement but
_G only because of global variables whereas Modulescripts only contain functions.
If modulescripts can take on variables, completely ignore my statement. |
|
sncplay42Join Date: 2008-11-27 Post Count: 11891 |
"What are you guys on about? They are two completely different things. You don't use one or the other."
I think it was pretty clear the question meant "do you implement libraries by storing them _G or using require/ModuleScripts?". |
|
EvraJoin Date: 2008-10-05 Post Count: 61 |
There is 0 reason to use _G now that ModuleScripts exist. I would like to see an argument otherwise. |
|
AlyteJoin Date: 2011-10-24 Post Count: 10090 |
I Agree With the Above Post, storing Value's in _G is Lame....ModuleScrp are Can Be use As _G but Fast'er cuz they Load Once. |
|
|
Not sure which I'd rather have, ModuleScripts are great for small functions that are used multiple times in normal scripts and local scripts. _G functions on the other hand are lovely for creating main functions and parsing states. |
|