Jump to content

myPlayer().getHealth() - Returning the wrong value?


Recommended Posts

Posted (edited)

I'm calling a class.function from the main class like this,

 

class name = new class(this);

class.function();

 

Within this function for example I am,

 

function (Script s)

{

 

s.log( Integer.toString( s.myPlayer.getHealth() ) );

 

}
 

But for some reason it is returning the wrong value.

Am I doing something wrong?

Edited by Zero
Posted

Use Skills to get the correct value.

(Skills.getDynamic I think, although its been a while and im not looking in the api.)

 

I believe that what you are trying to do will only return the correct value if your in combat or something like that.

 

I'll give that a try, thank you! 

It's hard to know this stuff when it isn't indicated in the docs.

  • Like 1

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...