#OOP
1 messages · Page 1 of 1 (latest)
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
ok
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
Ok thanks for the help!
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?
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
- Complete courses: https://codewithmosh.com
- Twitter: https://twitter.com/moshhamedani
- Facebook: https://www....
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?
learn metatable
Yes
even if im not currently having this problem i WILL be saving this thread