#CAN WE START UTILIZING MODULE SCRIPTS???!!?!?

1 messages · Page 1 of 1 (latest)

hot root
#

bro i see so many scripts in this channel not utilizing module scripts and js using server and client scripts like lock in buddy

median trout
#

no

hot root
#

yes

#

loser

median trout
#

modulescripts are for nerds

hot root
median trout
#

nerd

median trout
hot root
#

in the game

#

techinally, you can make an entire game off of them

median trout
#

you can make an entire game off scripts and localscripts too fingerguns

restive quartz
#

Also, GL making a game with 100% module scripts and nothing else to actually make them do anything lol

median trout
#

only answer them on occasion

small hinge
stiff tusk
#

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

tranquil brambleBOT
#

studio** You are now Level 14! **studio

small hinge
small hinge
#

And Janitor?

stiff tusk
# small hinge Have you ever tried OOP before?

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

small hinge
#
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!")
stoic flume
#

OOP means Object Oriented Programming btw

stiff tusk
#

@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..

median trout