GM12 - GM13 conversion - FindMetaTable(string)

So I’ve been trying to convert an addon and I believe the last error is to do with FindMetaTable() function.

The current code and error is:

Local Angle = Angle;local AngleForward = _R.Angle.Forward;
"attempt to index global ‘_R’ (a nill value).

From what I understand _R was a shortcut for FindMetaTable() but I’m not sure of what to put in there now to replace it.

Any help?

_R.Angle becomes FindMetaTable(“Angle”)

_R was like a shortcut to debug.getregistry(). If you want FindMetaTable, use it like this for angles:
local META = FindMetaTable(“Angle”)

Now, I’m not sure if Garry changed the metatable name for angles but it should be something similar if not.

EDIT: Ninja’d

you can also use (assuming ang is an angle object) getmetatable(ang).Forward or just ang.Forward depending on what you want to do.

I actually knew that it was FindMetaTable() but im also extremely stupid.

I’ve fixed it now to FindMetaTable(“Angle”).Forward


[editline]3rd December 2012[/editline]

Now I get to wonder how code errors when it’s commented out _

Because you ended the comment with ]]. Change it to quotes " " instead of []