Jump to content

Player health getters returning weird values


Recommended Posts

Posted (edited)

For some odd reason, no matter the method of trying to return the player's current health (percent or current). a weird value is returned. I'm accessing the getter through a private API instance, so it's being called as follows:

api.myPlayer().getHealthPrecent();

OR

api.myPlayer().getHealth();

OR

api.myPlayer().getCurrentHealth();

All of these return odd values. As an example, the account I've been testing scripts with has 13 HP, but getCurrentHealth() returns a different value than that.

 

Any ideas on what could be causing this?

Edited by Bitshift
Posted (edited)

For some odd reason, no matter the method of trying to return the player's current health (percent or current). a weird value is returned. I'm accessing the getter through a private API instance, so it's being called as follows:

api.myPlayer().getHealthPrecent();

OR

api.myPlayer().getHealth();

OR

api.myPlayer().getCurrentHealth();

All of these return odd values. As an example, the account I've been testing scripts with has 13 HP, but getCurrentHealth() returns a different value than that.

 

Any ideas on what could be causing this?

 

those methods all fall back to the health bar your character displays on top of its head when in combat. SO for example if you are fighting and you can see it. You will get the right values. If the hp bar goes way and you eat food. It will still have the old value instead of the new updated values. When the hp bar Is visible again the value gets updates.

 

Edited by Joseph

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...