Thread: partynumber
View Single Post
  #6  
Unread 06-01-2018, 11:34 AM
Garan's Avatar
Garan Garan is offline
The Undying
Interface Author - Click to view interfaces
 
Join Date: Oct 2010
Posts: 340
Several problems. First, you need to use an instance of the local player to retrieve the party and/or raid, not the class Turbine.Gameplay.Player. You are also referencing the function definitions GetParty and GetRaid rather than their results since you didn't include parenthesis.

To get an instance of the local player use:
local localPlayer = Turbine.Gameplay.LocalPlayer:GetInstance();

then to get the party, use:
local party = localPlayer:GetParty();
note the parenthesis.

I don't recall if GetParty requires the localPlayer to be passed (using the ':' notation automatically handles that) so you might be able to use the '.' notation, "localPlayer.GetParty()". I don't use the party API much because it has been sooo buggy in the past (failing to stay in synch with the game when players join/leave, failing to fire callbacks for events, etc.).

I would suggest looking at the code of existing plugins to see how to access the player's party (or any other functions you are interested in). There are several party related plugins under the Raiding and Instances category:
http://www.lotrointerface.com/downloads/cat67.html
Reply With Quote