#A question

1 messages · Page 1 of 1 (latest)

velvet fulcrum
#

Hello guys would I need to learn about OOP / Module scripts ? I think I am an intermediate level scripter maybe or a bit lower idk tbh but do I need to learn about them or aren't they important ? and what are like some really important things that I could learn and are very important in every script / game

earnest glade
velvet fulcrum
haughty geyser
#

@velvet fulcrum I put u on

earnest glade
earnest glade
haughty geyser
#

im joking

#

but he said oop Im js recommending what I personally thinks the best tutorial

earnest glade
#

Oh right. I didn't see that; only module scripts.

haughty geyser
#

;

#

is cold.

velvet fulcrum
earnest glade
haughty geyser
earnest glade
#

^^^

velvet fulcrum
forest sundial
#

OOP is a way to use custom data and methods on an object atleast for roblox

#

if you set the functions of a module and create an object using a .new() function (which creates a meta table), you can use that new 'object' as a sort of custom instance

#

for example, I made an AI NPC module using OOP that allows you to crate a new NPC object by calling module.new() and then that object has all the properties as a humanoid along with custom data that I added, such as wander() attack() skill1() passive() etc

#

it allows for less repetitiveness in your code and just overall easier work flow when you intend to make a more intricate system or something you will use multiple times

#
  • oh and using 'self' in the module script refers to the object you create during OOP so self.anything will be accessible later, for example, as NPC.anything when you create a new instance
haughty geyser
#

I was at the gym yh

white prawnBOT
#

studio** You are now Level 1! **studio

haughty geyser
#

yeah : just means you pass self as the first argument