Its the second day of 2020! (Depending on your time zone.)
Anyways, I have a problem here. How can I check the class type of a variable, if that variable is a built-in Roblox class?
I searched on the web for a solution, and I found that getmetatable can be used to get the class type of a variable. But, that only works for vanilla Lua, and not Roblox Lua. When I try getmetatable on a Roblox built-in class (Vector3, UDim2, CFrame, etc.), it return a string “the metatable is locked”.
So the metatable is locked (whatever that means). Is it that Roblox have set the built-in class to private? (I’m a beginner at OOP, so I don’t know if it’s possible to do that. If I’m wrong, correct me please .) And, are there anyways to solve this?
So typeof is essentially a Roblox function, but not a Lua function? Oh wow that’s interesting . That explains why I couldn’t find anything about typeof on the web. Because I searched for “check type of variable lua” instead of “check type of variable roblox”.
Oh also, I found this article about the release of typeof.