#OOP

1 messages · Page 1 of 1 (latest)

primal smelt
#

Could someone explain to me why i would be using it and when or how to use it? I have been seeing plenty of tutorials but still don't understand what is oop or how to use it or when to use it.

ripe horizon
#

oop helps you not repeat code

#

sure u can use functions but oop is just better

#

lets say u wanna make a gun system

#

you can make a module and with oop give attributes to a gun and make it so you can call the builder function of the module instead of making individual scripts for all guns

primal smelt
#

ok

ripe horizon
#

about learning it u might wanna try to read already made oop code and with that try to understand it and if u get stuck u can look it up in the documentation or seek for help

ripe horizon
#

(help from real people btw use ai as a last resort)

#

ywe

#

yw*

errant lotus
#

yo I also got a question @ripe horizon

I’ve always seen OOP as something that can’t really be limited but more like a process that, instead of using separate scripts, uses complete modules or loops within normal scripts, taking advantage of everything Luau has to offer. That’s why I think it can’t really be defined or restricted. Is that correct?

true sparrow
#

4 pillars of object-oriented programming: encapsulation, abstraction, inheritance and polymorphism.

❤️ Join this channel to get access to perks:
https://www.youtube.com/channel/UCWv7vMbMWH4-V0ZXdmDpPBA/join

✋ Stay connected

▶ Play video

Dive into the OOP paradigm and how it works within Luau.

For more, check out these links:
https://create.roblox.com/docs/luau/metatables
https://luau.org/typecheck

Chapters:
00:00 Intro
00:24 What is it?
01:36 Why do I care?
02:01 How do I it?
02:31 Example
03:25 Tangent
04:07 Example pt 2
09:59 When should I use it?

▶ Play video
#

learn metatable

gusty panther
#

even if im not currently having this problem i WILL be saving this thread