luau is for the most part, just a sandbox version of lua. As far as I know, roblox hasn’t changed tables and metatables That being said, oop can be made in exactly the same way.
While luau introduces types, you still have to define the data that these types hold, it does not fill this data in for you, it’s simply a way for Lua to have types for not only readability, but for Lua to optimize around these types. If you are making an object using LuaU you still have to initialize these variables manually and/or set a metatable on the object. Though when it comes to inheriting from types I’m uncertain if you would it has the capibility of inheriting such because of that.
EDIT: Seems like you can using the & operator to join two types.
By Luau “Type Inheritence”, I’m assuming you’re looking for a way to derivate types instead of making entire new types from scratch, and not so much about the metatable inheritance.
Luau provides intersection types using the & operator that can be used to join together two non-primitive user-defined table types.
So in the context of your AnimalClass, you can do this:
type Animal = { Age: number, Health: number, Position: Vector3, __index: any, new: any}
type Dog = Animal&{Bark:()->()}
To get a “subtype” Dog, which will also have the attributes of type Animal.
This is one big chunk of what I wanted.
I probably should’ve mentioned I’m using !strict, and I wanna use metatables to instantiate objects with default values/functions.
It seems using !strict will cause the editor to yell at you when using metatables to make objects. It seems I can’t have my cake and eat it too. Either way, I guess this is technically the solution to the question I asked.