I’ve been trying to understand metatables and the actual purpose of them. I know people say “it’s to create your own classes” but I don’t understand how I can

Here’s what I know:

Metatables can make custom classes.

  • They require a table.

  • it is object-oriented.

  • It keeps the scripts readable and not messy.

Thing’s I want to know:

  • How can I have a problem and use metatables to solve it?

  • How to actually use metatables?

  • Are metatables really needed?

  • What are actually classes?

This should be a short to long discussion, you can provide links and other sources, thanks for reading.

2 comments

0

Have you ever though of searching it up before asking? There's tons of sites and videos explaining on how they work. Here's a video which I thought was very helpful: https://www.youtube.com/watch?v=CYxMfVy5W00

0

I did search but i will look at the video