Need help with GetAssistTarget()

You can share your Lua Scripts with everybody here.

Need help with GetAssistTarget()

Postby adamlevine » Wed Jun 20, 2018 3:02 am

Need help with GetAssistTarget()
Good evening!

If I want to know the morale of a Monster in the assist window, I can get the value with:

Code:
myplayer = Turbine.Gameplay.LocalPlayer.GetInstance();
myparty = myplayer:GetParty();
morale = myparty:GetAssistTarget(1):GetTarget():GetMorale();
GetAssistTarget(1) specifies the first player in the assist window, correct?

Well, everything works fine so far but as soon as there is a second player added to the assist window, I get the following error: attempt to index a nil value

Why does everything work if there is only one player in the assist window but if there are more, it suddenly does not work any more?


Thank you in advance!
adamlevine
 
posts 1
 
joined Wed Jun 20, 2018 2:47 am

Re: Need help with GetAssistTarget()

Postby FTP » Fri Jun 22, 2018 1:15 pm

Sorry, do you mean Wing FTP Server?
FTP
Site Admin
 
posts 1577
 
joined Tue Sep 29, 2009 6:09 am


Return to Lua scripts

Who is online

Users browsing this forum: No registered users and 1 guest