I am calling an API function in the Lord of the Rings Online (LOTRO) Beta Lua scripting feature. The API method returns a "type" called ClassAttributes that will be on of the given Class Attribute "types". I say "types" because when I call type()
on the return value, it says its a table.
Is there a way for me to check the type, or metatable type? e.g.:
local returnedTable = player:GetClassAttributes();
if (returnedTable.Name == "CaptainClassAttributes")
print("You are playing a captain");
end
UPDATE The following code is what I use:
player = Turbine.Gameplay.LocalPlayer.GetInstance();
Turbine.Shell.WriteLine("player:GetClass():" .. player:GetClass());
Turbine.Shell.WriteLine("Turbine.Gameplay.Class.Captain:" .. Turbine.Gameplay.Class.Captain);
if (player:GetClass() == Turbine.Gameplay.Class.Captain) then
Turbine.Shell.WriteLine("You are playing a captain");
end
and here is the output:
player:GetClass():24
Turbine.Gameplay.Class.Captain:24
You are playing a captain