#CAN WE START UTILIZING MODULE SCRIPTS???!!?!?
1 messages · Page 1 of 1 (latest)
no
modulescripts are for nerds
no
nerd
module scripts r the most important scripts
in the game
techinally, you can make an entire game off of them
you can make an entire game off scripts and localscripts too 
Yeah, but 90% of the problems in here just either don't need them, or the people facing the problems are beginners who haven't learned to use them yet 😔
Also, GL making a game with 100% module scripts and nothing else to actually make them do anything lol
indeed, you may notice i don't ask any questions here
only answer them on occasion
If your gonna build your entire game using ModuleScripts, use a ModuleLoader.
whats a module loader
i might need this..
im having issues because i tried to 'clean up' my scripts using modulescripts... server was fine but as soon as i tried to move most of the client scripts i got so many errors especially since i had to add the character before some of the scripts run... then whenever i try to add the character again (for example when the player resets or dies) the modules dont reaload and they all break (on the client)
whats your solution to this?
also some of the client scripts include only running when a player is using a specific item and not all can be fixed with turning off 'reset on death' on the screengui
** You are now Level 14! **
It's basically requries modules.
Have you ever tried OOP before?
And Janitor?
never heard of janitor
i have "tried" OOP. but it never sticks properly in my head.. i barely understand metatables or how to implement inheritance etc.
ofcoarse i never practiced it alot so thats also my fault - i just rushing a little bit currently cuz im trying to get a game out and trying to fix over 1000 lines of code now is not viable for me currently even though i did try using modules but i already understand module scripts and havent been bothered to properly learn OOP yet
Let me show u an example of what OOP looks like, and it is quite simple, and fun!
local Class = {}
Class.__index = Class
-- CONSTRUCTOR
function Class.new(example)
local self = {}
setmetatable(self, Class)
self.Example = example
return self
end
function Class.saySomething(msg)
print(`msg`)
end
local newClass = Class.new()
newClass.saySomething("Hey!")
OOP means Object Oriented Programming btw
@small hinge i forgot what __index is - is it just anything that could be "called" so "Class.frog" (not exist yet) for example will just return "example" by default? a couple comments would help this a bit because if i took it 'literally' my brain would just melt from the first 2 lines thinking index is just the name of the first variable - like this:
Class = {__index = {__index = {__index = {__index = {__index --forever
im sure ill understand it eventually i might have to rewatch a few videos on it..
yes doing local t={} t.__index=t makes the table recursive