Sign Up

Sign Up to our social questions and Answers Engine to ask questions, answer people’s questions, and connect with other people.

Have an account? Sign In

Have an account? Sign In Now

Sign In

Login to our social questions & Answers Engine to ask questions answer people’s questions & connect with other people.

Sign Up Here

Forgot Password?

Don't have account, Sign Up Here

Forgot Password

Lost your password? Please enter your email address. You will receive a link and will create a new password via email.

Have an account? Sign In Now

You must login to ask a question.

Forgot Password?

Need An Account, Sign Up Here

Please briefly explain why you feel this question should be reported.

Please briefly explain why you feel this answer should be reported.

Please briefly explain why you feel this user should be reported.

Sign InSign Up

The Archive Base

The Archive Base Logo The Archive Base Logo

The Archive Base Navigation

  • SEARCH
  • Home
  • About Us
  • Blog
  • Contact Us
Search
Ask A Question

Mobile menu

Close
Ask a Question
  • Home
  • Add group
  • Groups page
  • Feed
  • User Profile
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Buy Points
  • Users
  • Help
  • Buy Theme
  • SEARCH
Home/ Questions/Q 3699108
In Process

The Archive Base Latest Questions

Editorial Team
  • 0
Editorial Team
Asked: May 19, 20262026-05-19T05:03:47+00:00 2026-05-19T05:03:47+00:00

I am calling an API function in the Lord of the Rings Online (LOTRO)

  • 0

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

  • 1 1 Answer
  • 0 Views
  • 0 Followers
  • 0
Share
  • Facebook
  • Report

Leave an answer
Cancel reply

You must login to add an answer.

Forgot Password?

Need An Account, Sign Up Here

1 Answer

  • Voted
  • Oldest
  • Recent
  • Random
  1. Editorial Team
    Editorial Team
    2026-05-19T05:03:48+00:00Added an answer on May 19, 2026 at 5:03 am

    The API docs are a bit confusing, although I suppose I found what you’re looking for.
    The following code should tell you if player is a Captain:

    local player = Turbine.Gameplay.Player
    if (player:GetClass() == Turbine.Gameplay.Class.Captain) then
        print("You are playing a captain")
    end
    

    Captain is a member of the Gameplay.Class table, which is just an integer number as reading from the docs.

    Note: You don’t need to end a Lua sentence with a “;”.

    Couldn’t test it. Hope it works.

    • 0
    • Reply
    • Share
      Share
      • Share on Facebook
      • Share on Twitter
      • Share on LinkedIn
      • Share on WhatsApp
      • Report

Sidebar

Related Questions

I am calling an API that returns JSON data. I am using json.loads to
I am calling an API which returns me a collection of objects. I want
I'm calling a Win32 API function and getting back a string padded with null
I am calling a JavaScript function using the rhino API: Function fct = context.compileFunction(scope,
I'm calling the following function on wininet.dll in order to get online (C# pinvoke):
Do calling an API function considered an expensive operation? (when comparing it to a
I am calling a google api function repeatedly in a loop. Each time i
I am calling a API Delete function it accept only DELETE verb. I have
I am calling my api which returns a task object via json (example return
I am calling an API, which should return a JSON file. Here is the

Explore

  • Home
  • Add group
  • Groups page
  • Communities
  • Questions
    • New Questions
    • Trending Questions
    • Must read Questions
    • Hot Questions
  • Polls
  • Tags
  • Badges
  • Users
  • Help
  • SEARCH

Footer

© 2021 The Archive Base. All Rights Reserved
With Love by The Archive Base

Insert/edit link

Enter the destination URL

Or link to existing content

    No search term specified. Showing recent items. Search or use up and down arrow keys to select an item.