Zero Posted May 30, 2015 Share Posted May 30, 2015 (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 May 30, 2015 by Zero Quote Link to comment Share on other sites More sharing options...
Mysteryy Posted May 30, 2015 Share Posted May 30, 2015 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. 1 Quote Link to comment Share on other sites More sharing options...
Zero Posted May 30, 2015 Author Share Posted May 30, 2015 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. 1 Quote Link to comment Share on other sites More sharing options...
FrostBug Posted May 31, 2015 Share Posted May 31, 2015 I'll give that a try, thank you! It's hard to know this stuff when it isn't indicated in the docs. It is, though. Quote Link to comment Share on other sites More sharing options...